Float to Int Conversions

John Love-Jensen eljay@adobe.com
Tue Feb 26 11:11:00 GMT 2002


Hi Stephen,

According to C++ Programming Language by Stroustrup, section C.6.2.6 --
the behavior is UNDEFINED (implementation dependent) if the truncated
value cannot be represented in the destionation type.

Not what you wanted to hear.  If you want consistent behavior, you'll
have to write a helper subroutine that catches the boundary cases.

--Eljay




More information about the Gcc-help mailing list