summaryrefslogtreecommitdiffstats
path: root/contrib/gdtoa/ulp.c
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2011-03-12 07:03:06 +0000
committerdas <das@FreeBSD.org>2011-03-12 07:03:06 +0000
commit22b42559b254072c025ee7660742d9096d6ddbfd (patch)
tree02fea95a802135fbb5d2f67a8c005bf132b6e256 /contrib/gdtoa/ulp.c
parentbb4fe3b8f6c28c422e237503dec22ccea5269dba (diff)
parenta0113107f8ebf649eb6c0730ece07fe0865a384b (diff)
downloadFreeBSD-src-22b42559b254072c025ee7660742d9096d6ddbfd.zip
FreeBSD-src-22b42559b254072c025ee7660742d9096d6ddbfd.tar.gz
Merge gdtoa-20110304.
Diffstat (limited to 'contrib/gdtoa/ulp.c')
-rw-r--r--contrib/gdtoa/ulp.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/contrib/gdtoa/ulp.c b/contrib/gdtoa/ulp.c
index 7810a5c..17e9f86 100644
--- a/contrib/gdtoa/ulp.c
+++ b/contrib/gdtoa/ulp.c
@@ -34,13 +34,13 @@ THIS SOFTWARE.
double
ulp
#ifdef KR_headers
- (x) double x;
+ (x) U *x;
#else
- (double x)
+ (U *x)
#endif
{
Long L;
- double a;
+ U a;
L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1;
#ifndef Sudden_Underflow
@@ -49,22 +49,22 @@ ulp
#ifdef IBM
L |= Exp_msk1 >> 4;
#endif
- word0(a) = L;
- word1(a) = 0;
+ word0(&a) = L;
+ word1(&a) = 0;
#ifndef Sudden_Underflow
}
else {
L = -L >> Exp_shift;
if (L < Exp_shift) {
- word0(a) = 0x80000 >> L;
- word1(a) = 0;
+ word0(&a) = 0x80000 >> L;
+ word1(&a) = 0;
}
else {
- word0(a) = 0;
+ word0(&a) = 0;
L -= Exp_shift;
- word1(a) = L >= 31 ? 1 : 1 << 31 - L;
+ word1(&a) = L >= 31 ? 1 : 1 << (31 - L);
}
}
#endif
- return a;
+ return dval(&a);
}
OpenPOWER on IntegriCloud