[TxMt] Re: rounding bug in Math bundle...

Alain Matthes alain.matthes at mac.com
Tue Dec 1 15:43:28 UTC 2009


Le 1 déc. 2009 à 16:34, Ale Muñoz a écrit :

> - Open a new document
> - Paste this:
> 
> ((72 / 2.54) * 2.54)
> 
> - Run the "Evaluate Line" command from the Math bundle.
> - Wonder where the result came from:
> 
> ((72 / 2.54) * 2.54) = 71.99999999999999999999
> 
> Really.

Hi

Why a bug ?

Firstly 71.99999... = 72 like 0.999 ... =1 

And in ((72 / 2.54) * 2.54)  (72 / 2.54) is the first evaluation
 so the result is 28.34645669 ... and finally you get something correct

Best regards

Alain Matthes




More information about the textmate mailing list