google / google/double-conversion
Document the required configuration of the CPU/FPU
- Dominant language
- C++
- Stars
- 1.2k
- Forks
- 308
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 12
Description
From http://code.google.com/p/double-conversion/issues/detail?id=36 :
When the FPU control word or _MM_SET_FLUSH_ZERO_MODE is toggled the algorithm doesn't work.
-- stephen.mercer
Can you go into more detail about the severity of this? If we were to use your code in our application, when would this occur? What could we do to prevent it? And when the algorithm doesn't work, does that mean your strings are junk or are they just not the shortest strings?
-- floitsch
_MM_SET_FLUSH_ZERO_MODE is used to flush denormals to 0 (see http://en.wikipedia.org/wiki/Denormal_number).
Quoting Arash Partow (author of http://www.codeproject.com/Articles/23198/C-String-Toolkit-StrTk-Tokenizer):
"But in short both the atod and dtoa functionalities of [the double-conversion] library have issues with double and float types when values approach denormalized but are not denormalized, there is inconsistent behavior from what is expected when the FPU control word or _MM_SET_FLUSH_ZERO_MODE is toggled - both from a performance and precision standpoint."
If you don't modify the __MM_SET_FLUSH_ZERO_MODE flag, or if you don't care about numbers with an absolute value <= 2.2250738585072009 × 10^−308 (or close to it), you should be fine.
Contributor guide
Assessment
This issue has not been assessed yet.