This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc 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 math/14803] Different ULPs depending on size of long int in GCC


http://sourceware.org/bugzilla/show_bug.cgi?id=14803

--- Comment #5 from Vincent LefÃvre <vincent-srcware at vinc17 dot net> 2012-11-04 23:32:38 UTC ---
(In reply to comment #1)
> But since GCC uses 160 bits internally, getting different results for a 
> 64-bit mantissa is a bit surprising unless one of the constants is 
> extremely close to a half-way value.

The constant is *exactly* a halfway value (see below).

(In reply to comment #3)
> It is:
> 
> ieee754/ldbl-96/e_asinl.c: pio2_hi =
> 1.5707963267948966192021943710788178805159986950457096099853515625L,

In binary, this is the 65-bit number:
1.1001001000011111101101010100010001000010110100011000010001101001

So, for a long double with 64-bit precision, this is a halfway value. BTW, I
suspect that this is not wanted, i.e. I would see this as a bug in the
e_asinl.c code.

> 32-bit long GCC encodes it as
> 
> 1.57079632679489661925640447970309310221637133509

Exactly 1.570796326794896619256404479703093102216371335089206695556640625, or
in binary: 1.100100100001111110110101010001000100001011010001100001000110101
(i.e. the constant rounded upward).

> and 64-bit long GCC encodes it as
> 
> 1.57079632679489661914798426245454265881562605500221252441

Exactly 1.5707963267948966191479842624545426588156260550022125244140625, or in
binary: 1.100100100001111110110101010001000100001011010001100001000110100 (i.e.
the constant rounded downward).

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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