Subj : Math Problem To : netscape.public.mozilla.jseng From : Thorsten R Date : Sun Sep 19 2004 01:46 pm Hello everybody, the following JS code: function qwe() { var d = 0.0; for (a = 0; a < 100000; a++) d += 0.1; return d; } print(qwe()); returns 10000.000000018848 Instead of 10000 The same code in C++ returns correctly 10000.000000 A few days ago someone posted also a problem with math precision, but it was answered that this is due to the nature of floating point math. But if this is the case here too, then why is the C++ code returning the correct result? Regards Thorsten .