Is there any definition how floating-point values evaluated at compile-time are rounded in C or C++ ? F.e. when I have double d = 1.0 / 3.0;
? I.e. what kind of rounding is done at compile-time.
And is there a definition of what's the default-rounding mode for a thread at runtime (C99's / C++11's fegetround()
/ fesetround()
) ?
And is rounding to integer-values also included in the latter configuration parameters ? Im aware of nearbyint()
, but this is specified to bound to the rounding-parameters which can be set by fesetround()
. What I'm concerned about is direct casting to an integer.