This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug c/42184] Same literal behaves differently as a double than as a long double



------- Comment #1 from kargl at gcc dot gnu dot org  2009-11-26 17:13 -------
I think that you may be looking at a library issue
and the conversion of a decimal string to binary.

Add
    printf("%La\n%La\n%La\n%La\n", value1, value2, value3, value4);

to your program yields
REMOVE:kargl[209] ./z
0x1.68f5c2c528fa3p+70
0x1.68f5c2c528fa3p+70
0x1.68f5c2c528fa3p+70
0x1.68f5c2c528fa36p+70
1 1 1 0

on FreeBSD.  If I replace 1.6646342e21 everywhere in your program
with 0x1.68f5c2c528fa3p+70, I get the result you expect, ie.,

REMOVE:kargl[212] ./z
0x1.68f5c2c528fa3p+70
0x1.68f5c2c528fa3p+70
0x1.68f5c2c528fa3p+70
0x1.68f5c2c528fa3p+70
1 1 1 1


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42184


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