This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: __ieee754_sqrt: don't truncate constants
- From: Jeff Johnston <jjohnstn at redhat dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: newlib at sourceware dot org
- Date: Mon, 25 May 2015 12:38:46 -0400 (EDT)
- Subject: Re: __ieee754_sqrt: don't truncate constants
- Authentication-results: sourceware.org; auth=none
- References: <201505221851 dot t4MIpX48026613 at greed dot delorie dot com>
Please go ahead.
-- Jeff J.
----- Original Message -----
From: "DJ Delorie" <dj@redhat.com>
To: newlib@sourceware.org
Sent: Friday, May 22, 2015 2:51:33 PM
Subject: __ieee754_sqrt: don't truncate constants
There's no reason to truncate this constant to "int", and on 16-bit
targets that breaks things anyway. OK?
* libm/math/e_sqrt.c (__ieee754_sqrt): Don't truncate constant to
"int".
diff --git a/newlib/libm/math/e_sqrt.c b/newlib/libm/math/e_sqrt.c
index 460125a..78fc524 100644
--- a/newlib/libm/math/e_sqrt.c
+++ b/newlib/libm/math/e_sqrt.c
@@ -99,7 +99,7 @@ static double one = 1.0, tiny=1.0e-300;
#endif
{
double z;
- __int32_t sign = (int)0x80000000;
+ __int32_t sign = 0x80000000;
__uint32_t r,t1,s1,ix1,q1;
__int32_t ix0,s0,q,m,t,i;