W3C home > Mailing lists > Public > site-comments@w3.org > May 2011

JavaScript Bug?

From: Khurram Adeeb Noorani <khurramnoorani@gmail.com>
Date: Wed, 04 May 2011 21:25:29 +0000
Message-Id: <BANLkTi=kxeynVrOriPZADAqvEMOy7s5YVA@mail.gmail.com>
To: site-comments@w3.org

I am writing you for the very first time in my life. Today I came across something really weired in JavaScript, I would call it a bug and it's my request that please have a look at it.

Please run the following script in your browser and you will see what I mean.

<script type="text/javascript">

Please don't say that rounding up will solve the problem. I know rounding up will solve the problem but the point is that there is something wrong. And it took hours to debug it because I really had no idea that there could have been such type of mistake/bug/issue in JavaScript. I was doing debugging somewhere else and the root cause was somewhere else. And the most interesting thing is that if you have num=0.13 and you add 0.01 to it, it will work fine. Problem occurs ONLY when you have num=0.14 and you add 0.01 to it.

It tested the above code on different machines (both Windows and Mac) and different browsers (Chrome, Firefox and Safari).

I've really no idea where to write and who to address therefore I'm sending an email to this address, kindly forward it to the concerned authorities.


Received on Thursday, 5 May 2011 05:33:21 UTC

This archive was generated by hypermail 2.4.0 : Monday, 18 April 2022 20:33:49 UTC