<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>hm, it seams that is not recomanded to use floating
numbers in js:</FONT></DIV>
<DIV><FONT face=Arial size=2><A
href="http://www.devx.com/webdev/Article/17215/1763/page/5">http://www.devx.com/webdev/Article/17215/1763/page/5</A></FONT></DIV>
<DIV><FONT face=Arial size=2>Anyway, in my case was ennough to multiply each nr.
of the sum with 1000, and then to devide the result with 1000 (I had the
precision 3 and not huge numbers).</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=costea.dan@ssi-schaefer.ro
href="mailto:costea.dan@ssi-schaefer.ro">Dan Costea</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=javascript@LaTech.edu
href="mailto:javascript@LaTech.edu">javascript@LaTech.edu</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Saturday, October 11, 2003 3:50
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Javascript] INCREDIBLE IE
BUG!!!!</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial size=2> Hi to all,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>If I'm blind or dreaming, please, let me know,
but, try this first:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>It's easy to make the following sum in your
head: 0.15 + 0.015 = 0.165 (OBVIOUS!)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>TRY THIS IN YOUR IE 6 WITH SP1: alert (0.15
+ 0.015); you will obtain: 164999999999999998</FONT></DIV>
<DIV><FONT face=Arial size=2>OR:</FONT></DIV>
<DIV><FONT face=Arial size=2>alert (0.15 + 0.015 - 0.15 - 0.015); - I
think the result is obvious for any human, but not for IE, that will return:
-1.3877787807814457e-17 (that indeed, is almost 0, but not realy
0...).</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I still can't believe it! And of course, those
are not special numbers. You can find many, many more (ex: 0.15+0.075, or
0.14+0.016) - I think the bug is in the cases that the sum of the last
digit of each number is 10, and the number of digits representing the
precision is different.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Regards,</FONT></DIV>
<DIV><FONT face=Arial size=2>Dan Costea.</FONT></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>Javascript mailing
list<BR>Javascript@LaTech.edu<BR>https://lists.LaTech.edu/mailman/listinfo/javascript<BR></BLOCKQUOTE></BODY></HTML>