diff options
Diffstat (limited to 'libquadmath/math')
-rw-r--r-- | libquadmath/math/cbrtq.c | 8 | ||||
-rw-r--r-- | libquadmath/math/j0q.c | 2 | ||||
-rw-r--r-- | libquadmath/math/sqrtq.c | 17 |
3 files changed, 15 insertions, 12 deletions
diff --git a/libquadmath/math/cbrtq.c b/libquadmath/math/cbrtq.c index 2567d4d..a7a36f95 100644 --- a/libquadmath/math/cbrtq.c +++ b/libquadmath/math/cbrtq.c @@ -56,10 +56,10 @@ Adapted for glibc October, 2001. #include "quadmath-imp.h" -static const long double CBRT2 = 1.259921049894873164767210607278228350570251Q; -static const long double CBRT4 = 1.587401051968199474751705639272308260391493Q; -static const long double CBRT2I = 0.7937005259840997373758528196361541301957467Q; -static const long double CBRT4I = 0.6299605249474365823836053036391141752851257Q; +static const __float128 CBRT2 = 1.259921049894873164767210607278228350570251Q; +static const __float128 CBRT4 = 1.587401051968199474751705639272308260391493Q; +static const __float128 CBRT2I = 0.7937005259840997373758528196361541301957467Q; +static const __float128 CBRT4I = 0.6299605249474365823836053036391141752851257Q; __float128 diff --git a/libquadmath/math/j0q.c b/libquadmath/math/j0q.c index c6e482b..2dc93d5 100644 --- a/libquadmath/math/j0q.c +++ b/libquadmath/math/j0q.c @@ -816,7 +816,7 @@ static __float128 Y0_2D[NY0_2D + 1] = { /* 1.000000000000000000000000000000000000000E0 */ }; -static const long double U0 = -7.3804295108687225274343927948483016310862e-02Q; +static const __float128 U0 = -7.3804295108687225274343927948483016310862e-02Q; /* Bessel function of the second kind, order zero. */ diff --git a/libquadmath/math/sqrtq.c b/libquadmath/math/sqrtq.c index f63c0d1..56ea5d3 100644 --- a/libquadmath/math/sqrtq.c +++ b/libquadmath/math/sqrtq.c @@ -32,14 +32,17 @@ sqrtq (const __float128 x) } #ifdef HAVE_SQRTL - if (x <= LDBL_MAX && x >= LDBL_MIN) { - /* Use long double result as starting point. */ - y = sqrtl ((long double) x); - - /* One Newton iteration. */ - y -= 0.5q * (y - x / y); - return y; + long double xl = (long double) x; + if (xl <= LDBL_MAX && xl >= LDBL_MIN) + { + /* Use long double result as starting point. */ + y = (__float128) sqrtl (xl); + + /* One Newton iteration. */ + y -= 0.5q * (y - x / y); + return y; + } } #endif |