From 439053ac840e0b920e51e42afc8f8a8320926942 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 5 Mar 2018 20:26:05 +0000 Subject: [PATCH] cbrt: make it friendly with non 64bit capable --- Library/libs/cbrt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Library/libs/cbrt.c b/Library/libs/cbrt.c index 3a310f38..353cb4ee 100644 --- 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 */ -- 2.34.1