openlibm icon indicating copy to clipboard operation
openlibm copied to clipboard

powl yields NaN instead of +0

Open zimmermann6 opened this issue 5 months ago • 0 comments

for x=0x1.98p-3072l and y=0xa.ab43b6dba9a6383p+16364l, powl yields NaN instead of +0 (even with only one thread, cf https://github.com/JuliaMath/openlibm/issues/222)

zimmerma@coriandre:~/svn/tbd/20/src/binary80$ cat test2_pow_openlibm.c #include <stdio.h> #include <math.h> #include <omp.h>

int main() { long double x = 0x1.98p-3072l; long double y = 0xa.ab43b6dba9a6383p+16364l; long double z; z = powl (x, y); printf ("z=%La\n", z); return 0; }

zimmerma@coriandre:~/svn/tbd/20/src/binary80$ gcc -fno-builtin test2_pow_openlibm.c /localdisk/zimmerma/openlibm-0.8.7/libopenlibm.a zimmerma@coriandre:~/svn/tbd/20/src/binary80$ ./a.out z=-nan

zimmerma@coriandre:~/svn/tbd/20/src/binary80$ gcc -fno-builtin test2_pow_openlibm.c -lm # with GNU libc zimmerma@coriandre:~/svn/tbd/20/src/binary80$ ./a.out z=0x0p+0

zimmermann6 avatar Sep 01 '25 07:09 zimmermann6