Previous Table of Contents "New C Standard" commentary
When a finite value of real floating type is converted to an integer
type other than
687 If the value of the integral part cannot be represented by the integer type, the behavior is undefined.50)
688 When a value of integer type is converted to a real floating type, if the value being converted can be represented exactly in the new type, it is unchanged.
689 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.
48) The integer promotions are applied only: as part of the usual
arithmetic conversions, to certain argument expressions, to the
operands of the unary
691 49) The rules describe arithmetic on the mathematical value, not the value of a given type of expression.
692 50) The remaindering operation performed when a value of integer type is converted to unsigned type need not be performed when a value of real floating type is converted to unsigned type.
Thus, the range of portable real floating values is
694 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
Created at: 2008-01-30 02:39:41 The text from WG14/N1256 is copyright © ISO