From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030922 Description of problem: The x86_64 ecvt() function returns "inf" or "-inf" for valid denormalized doubles. The function works correctly on i686 systems (same library version). Both systems running RHEL3 update 2. Version-Release number of selected component (if applicable): glibc-2.3.2-95.20 How reproducible: Always Steps to Reproduce: Compile and run the following program on both i686 and x86_64 systems. #include <stdio.h> #include <stdlib.h> #include <ieee754.h> main() { char* s; int decpt, sign, ndigits=7; union ieee754_double D; D.ieee.exponent = 0; /* denormalized */ D.ieee.negative = 0; D.ieee.mantissa0 = 0x0; /* MSB */ D.ieee.mantissa1 = 0x1; /* LSB */ printf("Input=%e\n", D.d); s = ecvt(D.d, ndigits, &decpt, &sign); printf("Output=%s, decpt=%d, sign=%d\n", s, decpt, sign); } Actual Results: On an x86_64 system: Input=4.940656e-324 Output=inf, decpt=-309, sign=0 Expected Results: On an i686 system: Input=4.940656e-324 Output=4940656, decpt=-323, sign=0 Additional info:
http://sources.redhat.com/ml/libc-hacker/2004-12/msg00069.html
Fix queued for RHEL3 U5 and RHEL4 U1.
Fix added to glibc-2.3.2-95.31, for the time being available from ftp://people.redhat.com/jakub/glibc/2.3.2-95.31/
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2005-256.html