2 ms·
Minor correction; the decimal context is thread-local, and not set '"globally" in the module'. It's similar in philosophy to C99's support for IEEE 754's round
by dalke 11y ago
Minor correction; the decimal context is thread-local, and not set '"globally" in the module'.
It's similar in philosophy to C99's support for IEEE 754's rounding modes and exception modes. Compare to http://en.cppreference.com/w/c/numeric/fenv http://en.cppreference.com/w/c/numeric/fenv :
> The floating-point environment is the set of floating-point status flags and control modes supported by the implementation. It is thread-local, each thread inherits the initial state of its floating-point environment from the parent thread.
Since standard floats in C have similar behavior, it's hard for me to agree that it's really a "quirk".