summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2006-12-24 22:24:39 +0000
committermarius <marius@FreeBSD.org>2006-12-24 22:24:39 +0000
commit7bebf7360da5e9c43f76567f5ef43445ac1f0c84 (patch)
treef75cc357ac1ff28b00dd251a2a8f61eca5c3ada6 /lib
parent30b466801f3898e0f3fd8300abe6a2b1213469a0 (diff)
downloadFreeBSD-src-7bebf7360da5e9c43f76567f5ef43445ac1f0c84.zip
FreeBSD-src-7bebf7360da5e9c43f76567f5ef43445ac1f0c84.tar.gz
Fix a typo in __fpu_ftox() that caused long double to long (and long long)
conversion of negative numbers to always result in -1. While at it, rearrange the nearby comment so it fits in 80 chars per line, like the rest of this file does. PR: 107130 MFC after: 1 day
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/sparc64/fpu/fpu_implode.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/libc/sparc64/fpu/fpu_implode.c b/lib/libc/sparc64/fpu/fpu_implode.c
index 2c3475e..a5b3817 100644
--- a/lib/libc/sparc64/fpu/fpu_implode.c
+++ b/lib/libc/sparc64/fpu/fpu_implode.c
@@ -259,14 +259,15 @@ __fpu_ftox(fe, fp, res)
case FPC_NUM:
/*
- * If exp >= 2^64, overflow. Otherwise shift value right
- * into last mantissa word (this will not exceed 0xffffffffffffffff),
- * shifting any guard and round bits out into the sticky
- * bit. Then ``round'' towards zero, i.e., just set an
- * inexact exception if sticky is set (see round()).
- * If the result is > 0x8000000000000000, or is positive and equals
- * 0x8000000000000000, overflow; otherwise the last fraction word
- * is the result.
+ * If exp >= 2^64, overflow. Otherwise shift value
+ * right into last mantissa word (this will not exceed
+ * 0xffffffffffffffff), shifting any guard and round
+ * bits out into the sticky bit. Then ``round'' towards
+ * zero, i.e., just set an inexact exception if sticky
+ * is set (see round()).
+ * If the result is > 0x8000000000000000, or is positive
+ * and equals 0x8000000000000000, overflow; otherwise
+ * the last fraction word is the result.
*/
if ((exp = fp->fp_exp) >= 64)
break;
@@ -277,7 +278,7 @@ __fpu_ftox(fe, fp, res)
if (i >= ((u_int64_t)0x8000000000000000LL + sign))
break;
if (sign)
- i = -1;
+ i = -i;
res[1] = (int)i;
return (i >> 32);
OpenPOWER on IntegriCloud