Real floating types

Previous Table of Contents "New C Standard" commentary

695 When a float is promoted to double or long double, or a double is promoted to long double, its value is unchanged (if the source value is represented in the precision and range of its type).

696 When a double is demoted to float, a long double is demoted to double or float, or a value being represented in greater precision and range than required by its semantic type (see is explicitly converted to its semantic type (including to its own type), if the value being converted can be represented exactly in the new type, it is unchanged.

697 If the value being converted is in the range of values that can be represented but cannot be represented exactly, the result is either the nearest higher or nearest lower representable value, chosen in an implementation-defined manner.

698 If the value being converted is outside the range of values that can be represented, the behavior is undefined.


Created at: 2008-01-30 02:39:41 The text from WG14/N1256 is copyright © ISO