Friday, June 10, 2005

Javascript Multiplication Bug

Sometimes it just doesn't pay to even try. Found a bug in the javascript multiplication engines of Internet Explorer, Mozilla, Opera, and who knows how many other browsers. Now, maybe I am just doing something wrong, but......

Try this with javascript:

alert(10 * 25.01);

It returns 250.10000000000002 ?!?!?!?!

Now, tell me why does that not return a value of 250.1 ?

No comments: