Excel + Calculations

  1. StevieTNZ

    StevieTNZ 985
    Gold Member

    Hi there,

    If I perform the following calculation in Excel:
    =100,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000+50

    I get: 100,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000

    Shouldn't the answer be:
    100,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,050?
     
  2. jcsd
  3. phinds

    phinds 8,734
    Gold Member

    No, the answer will be constrained by the number of bits used by the computer to represent the numbers, and you've got WAY more than it can handle, so the 50 gets dropped as a rounding error.
     
  4. jtbell

    Staff: Mentor

  5. StevieTNZ

    StevieTNZ 985
    Gold Member

    Is there any other program out there that will present the result given in my original post?
     
  6. Lots of other programs can do that.
    Computer Algebra Systems, like Mathematica, Sage, Maxima, Reduce, Maple... all do that.
    http://en.wikipedia.org/wiki/Computer_algebra_system

    Some calculator programs, like bc and many others do that.
    https://www.google.com/search?q=big+integer+calculator&oq=big+integer+calculator

    Many programming languages, like Icon, Java... do that, don't be fooled by those who think 64 bits is big.
    https://www.google.com/search?q=programming+language+big+integer&oq=programming+language+big+integer
     
  7. Chronos

    Chronos 9,971
    Science Advisor
    Gold Member

    64 bits is chump change for deep calculations. You need a monster computer to process calculations beyond a few hundred decimal points. That is why numerical analysis takes so long and is so incredibly expensive.
     
  8. harborsparrow

    harborsparrow 403
    Gold Member

    Just for grins, try putting the smaller number first.
     
  9. phinds

    phinds 8,734
    Gold Member

    Do you really think that's going to have any effect on the fact that the larger number is WAY bigger than Excel can handle as an integer?
     
  10. harborsparrow

    harborsparrow 403
    Gold Member

    Sometimes it does help to prevent loss of precision by putting the smaller number first, when there is a huge range of magnitude difference between two operands.
     
  11. phinds

    phinds 8,734
    Gold Member

    Yes, and that does not answer my question at all. I am asking about a specific case.
     
Know someone interested in this topic? Share a link to this question via email, Google+, Twitter, or Facebook

Have something to add?

0
Draft saved Draft deleted