Floating point exception in strtod()

Soegtrop, Michael michael.soegtrop@intel.com
Mon Apr 9 14:46:00 GMT 2018


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.
 
Best regards,

Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
 ТÒÐÐ¥&ö&ÆVÒ&W÷'G3¢‡GG¢òö7–wv–âæ6öÒ÷&ö&ÆV×2æ‡FÖÀФd¢‡GG¢òö7–wv–âæ6öÒöfðФFö7VÖVçFF–ö㢇GG¢òö7–wv–âæ6öÒöFö72æ‡FÖÀÐ¥Vç7V'67&–&R–æfó¢‡GG¢òö7–wv–âæ6öÒöÖÂò7Vç7V'67&–&R×6–×ÆPРÐ


More information about the Cygwin mailing list