From: SourceForge.net <no...@so...> - 2004-02-11 20:04:45
|
Bugs item #893402, was opened at 2004-02-10 02:57 Message generated for change (Comment added) made by dannysmith You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=893402&group_id=2435 >Category: gcc Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Darrin Forelle (darrinf) Assigned to: Danny Smith (dannysmith) Summary: hexadecimal floating-point constants Initial Comment: 1.c: #include <stdio.h> int main(void){ return printf("2.228e-05 = %g\n", (double) 0X1.75CBDF111D08CF5CP-16l); } gcc 1.c -o 1.exe & 1 2.228e-05 = 0 Tested with gcc v3.3.1 (mingw special 20030804-1). ---------------------------------------------------------------------- >Comment By: Danny Smith (dannysmith) Date: 2004-02-12 09:03 Message: Logged In: YES user_id=11494 Fixed in GCC CVS. The problem was with uppercase 'X'. ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2004-02-10 11:44 Message: Logged In: YES user_id=11494 Sorry, my earlier comments were completely wrong. It has nothing to do with printf. GCC doesn't like uppercase in hexdec fp constants. This works: #include <stdio.h> int main(void){ return printf("2.228e-05 = %g\n", (double) 0x1.75cbdf111d08cf5cp-16l); } ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2004-02-10 11:04 Message: Logged In: YES user_id=11494 The printf supplied by the MSVC runtime is not C99 compliant and does not support headecimal FP constants. Nor does strtod. Sorry. Danny ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=893402&group_id=2435 |