

Visual C++ strtod(): Still Broken - nly
http://www.exploringbinary.com/visual-c-plus-plus-strtod-still-broken/

======
userbinator
Note that this is "broken" in a _very_ tiny way, which is unlikely to cause
any real-world problems in code which uses floating-point correctly, i.e. does
not rely on its exactness (or lack thereof.) It's not like with integers,
where e.g. 1000000 becoming 999999 or 1000001 would be a _severe_ bug.

If you're interested in the details of floating-point maths, the rest of the
site has other fascinating articles too. Converting strings to and from
floating-point correctly in all cases turns out to be quite a tricky thing to
do in practice.

~~~
gliptic
There's nothing wrong with relying on floating point to be "exact". That is,
correctly rounded. As exact as it can be.

~~~
TillE
Yes, but if you care about reading in exact numbers from text, floating point
is usually not the right tool for the job.

~~~
pcwalton
It's perfectly fine as long as you know the rules. Virtually all JavaScript
code is heavily reliant on exact answers from floating point (since floating
point is all you have) and it continues to work. :)

~~~
im3w1l
They are heavily reliant on exact answers for the subset of small integers.
But not that edges cases are handled 100% correct. Denormals, trigs of very
large number, parsing of numbers with lots of significant figures.

It could lead to degraded precision for mathematical calculations with lots of
steps, but that should be a problem for only a small minority of js code.

