This is the mail archive of the cygwin mailing list for the Cygwin 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: Floating point exception in strtod()


On Apr  9 14:45, Soegtrop, Michael wrote:
> Dear Corinna,
> 
> > L is of type Long == int32_t, aadj is of type double.  The value of
> > aadj at this time is 2529648000.0 == 0x96c75d80 which appears to be
> > perfectly valid for a 32 bit int.
> 
> 2529648000 is a valid unsigned long, but not a valid signed long. The
> largest 32 bit long is 2^31-1 = 2147483647. 0x96c75d80 interpreted as
> a signed long is a negative number.
> 
> I would say if floating point instructions are used to convert
> 2529648000 to a signed 32 bit integer, they should produce an
> FE_INVALID exception.

...which is what I described in the rest of my mail :)


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: signature.asc
Description: PGP signature


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