From 23a6adc2c38454ff01231a82841e9c8a0c09ff45 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Mon, 8 Mar 2010 17:16:37 +0000 Subject: 2010-03-08 Craig Howland * libm/common/s_rint.c: Fix error when integral part had 18 bits and fraction had bits set beyond first radix bit. Also, make 2-part adjustment consistent with 1-part adjustment when adjusting fractional bits. * libm/common/sf_rint.c: Make fractional-bit adjustment consistent with s_rint.c by setting 0b.01 instead of 0b.001. --- newlib/libm/common/sf_rint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'newlib/libm/common/sf_rint.c') diff --git a/newlib/libm/common/sf_rint.c b/newlib/libm/common/sf_rint.c index 6459b7a4c..bc0b46659 100644 --- a/newlib/libm/common/sf_rint.c +++ b/newlib/libm/common/sf_rint.c @@ -57,7 +57,7 @@ TWO23[2]={ i = (0x007fffff)>>j0; if((i0&i)==0) return x; /* x is integral */ i>>=1; - if((i0&i)!=0) i0 = (i0&(~i))|((0x100000)>>j0); + if((i0&i)!=0) i0 = (i0&(~i))|((0x200000)>>j0); } } else { if(!FLT_UWORD_IS_FINITE(ix)) return x+x; /* inf or NaN */ -- cgit v1.2.3