glibc/tests/Regression/bz656530-sqrtl-returns-highly-incorrect-results-for-some/sqrt.c
Sergey Kolosov ab4bc8a24e Extend the test coverage
Move some of the RHEL QE testcases upstream to Fedora.
2022-05-31 09:29:27 +02:00

25 lines
393 B
C

/*
* bz#656530
* Fix comparison in sqrtl for IBM long double 128
* http://sourceware.org/ml/libc-alpha/2010-11/msg00033.html
*/
#include <math.h>
#include <stdio.h>
int main()
{
long double x, y, sum, root;
x = 0x1.c30000000029p-175;
y = 0x1.49p+504;
sum = x*x + y*y;
root = sqrtl(sum);
printf("%a\n", (double)root);
/* should produce 0x1.49p+504 and not -inf */
return 0;
}