This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Float to Int Conversions
- From: John Love-Jensen <eljay at adobe dot com>
- To: Stephen Pisuk <smp at ll dot mit dot edu>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 26 Feb 2002 11:36:56 -0600
- Subject: Re: Float to Int Conversions
- References: <Pine.GSO.4.44.0202261134320.20318-100000@lager>
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