Message Boards Message Boards

Open Office Calc and Excel miscalculation?

Posted 9 years ago

Why when we calculate 2^64 in Open Office Calc and Excel the result is 18.446.744.073.709.600.000 and when we do it in Wolfram Alpha and http://web2.0calc.es/ the result is 18.446.744.073.709.551.616? What is wrong? What is the true answer? Thanks. Pere

POSTED BY: PERE PUJOL
5 Replies

Notice that it never ends with zero:

Column[NestList[2 # &, 1, 64], Alignment -> Right]

doubling numbers

and the last digits follow this sequence:

Graph[Rule @@@ Partition[Last /@ IntegerDigits /@ NestList[2 # &, 1, 64], 2, 1], VertexLabels -> "Name"]

sequence of last digits

1 24862 24862 24862 24862 etc

POSTED BY: Gustavo Delfino

The latter is right. 2^n can never end on a zero; The last digits of something that is doubling behaves like this:

Graph[Table[n -> Mod[2 n, 10], {n, 0, 9}], VertexLabels -> "Name"]

enter image description here

as you can see, the last digit will go through a cycle: 2,4,8,6,2,4,8,6......... which you can check for the first 2^n:

2,4,8,16,32,64,128,256,512,1024,2048,...

indeed that matches. This does not mean the wolframalpha is correct, but is certainly proofs that excels and Open Office Calc are incorrect. (mainly because they use machine precision numbers and they can not contain all the digits (only 53 binary digits for a double-precision-number if I recall correctly)).

POSTED BY: Sander Huisman

I can assure you though that WolframAlpha is correct, but the 'proof' can only be checked by actually doing the calculation using a system that can handle such big numbers; Mathematica and WolframAlpha are one of those systems...

POSTED BY: Sander Huisman
Posted 9 years ago

I supposed this, but I did not understand why. Thank you very much.

POSTED BY: PERE PUJOL
Posted 9 years ago

Thank you very much. Please, what software did you use to calculate the series of numbers?

POSTED BY: Updating Name
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract