Titan's blog

13 December 2005

"Not enough mana!"

1 - 0.9 - 0.1 = 0? Apparently not! (there is this joke: Q: when 2 + 2 = 5? A: for large values of 2)

And speaking of errors in real life...Fake or Photo?

Computers are getting a hard time removing the error in a simple computation, but have a hard time trying to represent imperfect things from real life...

Update:
Seems to me, no one has this wright (and probably never will because of that floating point binary representation)
  • Google's Calculator: 1 - 0.9 - 0.1 = -2.77555756 × 10-17
  • Ruby: 1 - 0.9 - 0.1 = -2.77555756156289e-17
  • PHP(4.4): 1 - 0.9 - 0.1 = -2.7755575615629e-17
  • JavaScript:1 - 0.9 - 0.1 = -2.7755575615628914e-17
  • VbScript: 1 - 0.9 - 0.1 = -2,77555756156289E-17
  • Java2: 1 - 0.9 - 0.1 = -2.7755575615628914E-17
  • Perl 5: 1 - 0.9 - 0.1 = -2.77555756156289e-017
  • C#: 1 - 0.9 - 0.1 = -2.7755575615628914E-17
  • VC++: 1 - 0.9 - 0.1 = -2.7755575615628914e-017
Instead, 1 - 0.1 - 0.9 = 0, at least in VC++, C# and Google's Calculator...

1 Comments:

  • Hehehe Super tare Google. BTW Este normal si logic ca 1 + 0.9 - 0.1 sa nu fie 0. Poate ai dorit sa scrii 1 - 0.9 - 0.1 :). Skimba tata. Super tare google calc.

    By Anonymous Anonymous, at Tuesday, December 13, 2005 6:20:00 PM  

Post a Comment

<< Home


 
counter easy hit