kayws426 / embox

Automatically exported from code.google.com/p/embox
0 stars 1 forks source link

fdlib for long double #660

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Problem: __ieee754_powl (x=10, y=2) == 0. May be all functions for long double 
not work correctly.

When we call __ieee754_powl (x=10, y=2), it split y to hi and lo part, but 
after that iy==0 and ly==0:
third-party/lib/fdlibm/e_powl.c
109     hy = __HI(y); ly = __LO(y);
110     ix = hx&0x7fffffff;  iy = hy&0x7fffffff;
111 
112     /* y==zero: x**0 = 1 */
113     if((iy|ly)==0) return one;

It's because __HI and __LO macros are wrong for 12 bytes long double:
third-party/lib/fdlibm/fdlibm.h
 20 #define __HI(x) *(1+(int*)&x)
 21 #define __LO(x) *(int*)&x

Original issue reported on code.google.com by ki.stfu on 23 Oct 2013 at 6:21

GoogleCodeExporter commented 9 years ago

Original comment by ki.stfu on 23 Oct 2013 at 9:08

GoogleCodeExporter commented 9 years ago
fdlib replaced with openlibm, please, reopen if problem still there

Original comment by drakon.m...@gmail.com on 16 Mar 2015 at 1:47