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/13563] New: LoP asinl returns unexpected value on long double


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

             Bug #: 13563
           Summary: LoP asinl returns unexpected value on long double
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: aj@suse.de
        ReportedBy: guojiufu@gmail.com
    Classification: Unclassified


#include <stdio.h>
#include <float.h>
#include <math.h>

typedef union { long double ld; struct{long l1, l2, l3, l4;} s; } U ;

int main(void) {
   U u ;
   long double arg = (1.L-((__extension__ 0x1p-105L))/(long double)2);
   long double a = asinl(arg);

   u.ld = arg ;
   printf("size of long double=%d long=%d\n", sizeof(long double),
sizeof(long));
   printf("%X %X %X %X\n", u.s.l1,u.s.l2,u.s.l3,u.s.l4);
   printf("%.30Lg\n",arg);
   printf("%.30Lg\n",a);

 return 0;
}

> gcc t.c -lm;./a.out

EXPECTED OUTPUT:

size of long double=8 long=4
3FF00000 0 FE97FF4 0
1
1.57079632679489655799898173427


ACTUAL OUTPUT:
size of long double=16 long=4
3FF00000 0 B9500000 0
1
nan   <-should be 1.570796326794....

This issue happens at Linux on Power system

-- 
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]