interesting calculator behavior!?

Romain Kang romain at kzsu.stanford.edu
Tue Aug 26 09:13:23 PDT 2003


On the subject of computer representation of numbers, I remember
seeing buttons at computer flea markets that said
 2 + 2 = 5
 for large
values of 2

This is easy to show if your calculator is limited to external
display of integer values but can carry additional internal precision.
If the internal value is 2.375, the most accurate external display
is "2".  If you add "2" + "2", you get 4.75 internally, or "5"
externally.

You can use this fact to nail ignorant pedants who rhetorically
ask, "Doesn't 2 + 2 equal 4?"

Romain Kang                             Disclaimer: I speak for myself alone,
romain at kzsu.stanford.edu                except when indicated otherwise.



More information about the Titanium mailing list