[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Full-disclosure] Firefox 2.0.0.7 has a very serious calculation bug



carl hardwick wrote:
> PoC concept here:
> javascript:5.2-0.1
> (copy this code into address bar)
> 
> Firefox 2.0.0.7 result: 5.1000000000000005 (WRONG!)
> Internet Explorer 7 result: 5.1 (OK)

In IE7 and Opera I get the same thing you do for Firefox. This is not
surprising because the ECMAScript specification says that floating point
operations must comply with ANSI/IEEE Std 754-1985: IEEE Standard for
Binary Floating-Point Arithmetic.

The ECMAScript version 4 proposal introduces a decimal type intended to fix
up some of weirdness caused by mapping base-2 floating point rounding back
into base-10 notation.

_______________________________________________
Full-Disclosure - We believe in it.
Charter: http://lists.grok.org.uk/full-disclosure-charter.html
Hosted and sponsored by Secunia - http://secunia.com/