There is a great paper about this out there, but you can get the gist
here:  http://floating-point-gui.de/

On Fri, May 11, 2012 at 10:41 AM, Yogesh Agrawal <saggiyog...@gmail.com>wrote:

> Hi,
>
> I am performing a simple calculation in node.js, but receiving strange
> result.
>
> 0.2 + 0.1 should be equal to 0.3
>
> but in nodejs it's 0.30000000000000004
>
> I tried same calculation on browser also
> http://jsbin.com/amizah/edit#javascript,html
>
> same results.
>
> It's a bug or some floating point precision with js.
>
> Any workaround to get correct answer.
>
>  --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to