Results 1 to 9 of 9

Thread: Max calculation i can do?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448

    Max calculation i can do?

    I am writing a program that can calculate something that never stops like 1/3, and i was wondering what is the max place i could take something to? If i have this calcuating will it freez the computer? Im not doing 1/3 but im doing a calulatino that goes on for ever. And am just wondering the max calcuation i can do.

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    depends what you want to calculate and where you want to store your number, the decimals of rational numbers repeats themselves, so its not particularly hard but calculating trancendent numbers needs some strategy, but theoretically i dont think theres but physical limits, like ram/hdd space.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    im going to calculate it on a computer with 512mb ram, and a 100gig harddrive. im going to store it in just like a text file or something.

  4. #4
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    On my system, .dat files larger than 10MB tend to become difficult to read (and to send via internet. I have 56k ) However, depending on how you set your data structure / technique of storage, you can get pretty large.

    If you don't me asking, what are you calculating?

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    well its not an actualy calculation i guess. but im going to have the program calculate every posible outcome for 20 digets with all caricters.

    what operating system should i use?

  6. #6
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    if you are doing this in C++, it does not really matter, though I'm a bit confused of what you are attempting.

  7. #7
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    I think you should limit your concerns to what datatype to use to store your intermediate and final results.
    For floating point use long double, integers use _int64

    20 significant digits is no big deal, really.

    From MSDN
    long double

    The long double contains 80 bits: 1 for sign, 15 for exponent, and 64 for mantissa. Its range is +/–1.2E4932 with at least 19 digits of precision. Although long double and double are separate types, the representation of long double and double is identical.


    _int64

    64 bit signed or unsigned integer

  8. #8
    Hyperactive Member
    Join Date
    Sep 2001
    Posts
    396
    VC5 and above doesn't support long double. long double defaults to double in VC, though they cannot be interchanged.

    MS made this decision when it was designing WinNT and NT is supposed to run on other platforms as well and not all CPU's FPUs (other than Intel's) support 80bit long double.

  9. #9
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    If that is a problem, then you can always implement it in an array.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width