public
/
FUZIX.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ded69a6
)
cbrt: make it friendly with non 64bit capable
author
Alan Cox
<alan@linux.intel.com>
Mon, 5 Mar 2018 20:26:05 +0000
(20:26 +0000)
committer
Alan Cox
<alan@linux.intel.com>
Mon, 5 Mar 2018 20:26:05 +0000
(20:26 +0000)
Library/libs/cbrt.c
patch
|
blob
|
history
diff --git
a/Library/libs/cbrt.c
b/Library/libs/cbrt.c
index
3a310f3
..
353cb4e
100644
(file)
--- a/
Library/libs/cbrt.c
+++ b/
Library/libs/cbrt.c
@@
-93,7
+93,14
@@
double cbrt(double x)
* before the final error is larger than 0.667 ulps.
*/
u.value = t;
+#ifdef NO_64BIT
+ if (u.bits[LOBIT] & 0x80000000UL)
+ u.bits[HIBIT]++;
+ u.bits[LOBIT] ^= 0x80000000UL;
+ u.bits[LOBIT] &= 0xC0000000UL;
+#else
u.bits = (u.bits + 0x80000000) & 0xffffffffc0000000ULL;
+#endif
t = u.value;
/* one step Newton iteration to 53 bits with error < 0.667 ulps */