This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Float to Int Conversions


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]