cbrtq.c (cbrtq): Use Q suffixed floating point constants instead of L suffixed ones.

* math/cbrtq.c (cbrtq): Use Q suffixed floating point constants
	instead of L suffixed ones.
	* math/fmaq.c (fmaq): Likewise.
	* math/rintq.c (TWO112): Likewise.

From-SVN: r194475
This commit is contained in:
Jakub Jelinek 2012-12-13 13:35:56 +01:00 committed by Jakub Jelinek
parent 65f141179f
commit de137957bd
4 changed files with 23 additions and 16 deletions

View File

@ -1,3 +1,10 @@
2012-12-13 Jakub Jelinek <jakub@redhat.com>
* math/cbrtq.c (cbrtq): Use Q suffixed floating point constants
instead of L suffixed ones.
* math/fmaq.c (fmaq): Likewise.
* math/rintq.c (TWO112): Likewise.
2012-12-03 Tobias Burnus <burnus@net-b.de> 2012-12-03 Tobias Burnus <burnus@net-b.de>
* strtod/strtod_l.c (___STRTOF_INTERNAL): Fix exponent * strtod/strtod_l.c (___STRTOF_INTERNAL): Fix exponent

View File

@ -88,11 +88,11 @@ cbrtq ( __float128 x)
/* Approximate cube root of number between .5 and 1, /* Approximate cube root of number between .5 and 1,
peak relative error = 1.2e-6 */ peak relative error = 1.2e-6 */
x = ((((1.3584464340920900529734e-1L * x x = ((((1.3584464340920900529734e-1Q * x
- 6.3986917220457538402318e-1L) * x - 6.3986917220457538402318e-1Q) * x
+ 1.2875551670318751538055e0L) * x + 1.2875551670318751538055e0Q) * x
- 1.4897083391357284957891e0L) * x - 1.4897083391357284957891e0Q) * x
+ 1.3304961236013647092521e0L) * x + 3.7568280825958912391243e-1L; + 1.3304961236013647092521e0Q) * x + 3.7568280825958912391243e-1Q;
/* exponent divided by 3 */ /* exponent divided by 3 */
if (e >= 0) if (e >= 0)
@ -122,9 +122,9 @@ cbrtq ( __float128 x)
x = ldexpq (x, e); x = ldexpq (x, e);
/* Newton iteration */ /* Newton iteration */
x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L; x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333Q;
x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L; x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333Q;
x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L; x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333Q;
if (sign < 0) if (sign < 0)
x = -x; x = -x;

View File

@ -80,7 +80,7 @@ fmaq (__float128 x, __float128 y, __float128 z)
< IEEE854_FLOAT128_BIAS - FLT128_MANT_DIG - 2) < IEEE854_FLOAT128_BIAS - FLT128_MANT_DIG - 2)
{ {
int neg = u.ieee.negative ^ v.ieee.negative; int neg = u.ieee.negative ^ v.ieee.negative;
__float128 tiny = neg ? -0x1p-16494L : 0x1p-16494L; __float128 tiny = neg ? -0x1p-16494Q : 0x1p-16494Q;
if (w.ieee.exponent >= 3) if (w.ieee.exponent >= 3)
return tiny + z; return tiny + z;
/* Scaling up, adding TINY and scaling down produces the /* Scaling up, adding TINY and scaling down produces the
@ -88,7 +88,7 @@ fmaq (__float128 x, __float128 y, __float128 z)
TINY has no effect and in other modes double rounding is TINY has no effect and in other modes double rounding is
harmless. But it may not produce required underflow harmless. But it may not produce required underflow
exceptions. */ exceptions. */
v.value = z * 0x1p114L + tiny; v.value = z * 0x1p114Q + tiny;
if (TININESS_AFTER_ROUNDING if (TININESS_AFTER_ROUNDING
? v.ieee.exponent < 115 ? v.ieee.exponent < 115
: (w.ieee.exponent == 0 : (w.ieee.exponent == 0
@ -100,7 +100,7 @@ fmaq (__float128 x, __float128 y, __float128 z)
volatile __float128 force_underflow = x * y; volatile __float128 force_underflow = x * y;
(void) force_underflow; (void) force_underflow;
} }
return v.value * 0x1p-114L; return v.value * 0x1p-114Q;
} }
if (u.ieee.exponent + v.ieee.exponent if (u.ieee.exponent + v.ieee.exponent
>= 0x7fff + IEEE854_FLOAT128_BIAS - FLT128_MANT_DIG) >= 0x7fff + IEEE854_FLOAT128_BIAS - FLT128_MANT_DIG)
@ -296,7 +296,7 @@ fmaq (__float128 x, __float128 y, __float128 z)
{ {
w.value = a1 + u.value; w.value = a1 + u.value;
if (w.ieee.exponent == 227) if (w.ieee.exponent == 227)
return w.value * 0x1p-226L; return w.value * 0x1p-226Q;
} }
/* v.ieee.mant_low & 2 is LSB bit of the result before rounding, /* v.ieee.mant_low & 2 is LSB bit of the result before rounding,
v.ieee.mant_low & 1 is the round bit and j is our sticky v.ieee.mant_low & 1 is the round bit and j is our sticky
@ -305,8 +305,8 @@ fmaq (__float128 x, __float128 y, __float128 z)
w.ieee.mant_low = ((v.ieee.mant_low & 3) << 1) | j; w.ieee.mant_low = ((v.ieee.mant_low & 3) << 1) | j;
w.ieee.negative = v.ieee.negative; w.ieee.negative = v.ieee.negative;
v.ieee.mant_low &= ~3U; v.ieee.mant_low &= ~3U;
v.value *= 0x1p-226L; v.value *= 0x1p-226Q;
w.value *= 0x1p-2L; w.value *= 0x1p-2Q;
return v.value + w.value; return v.value + w.value;
} }
v.ieee.mant_low |= j; v.ieee.mant_low |= j;

View File

@ -27,8 +27,8 @@
static const __float128 static const __float128
TWO112[2]={ TWO112[2]={
5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */ 5.19229685853482762853049632922009600E+33Q, /* 0x406F000000000000, 0 */
-5.19229685853482762853049632922009600E+33L /* 0xC06F000000000000, 0 */ -5.19229685853482762853049632922009600E+33Q /* 0xC06F000000000000, 0 */
}; };
__float128 __float128