From: Alan Cox Date: Mon, 5 Mar 2018 20:27:07 +0000 (+0000) Subject: fabs: make friendly with non uint64_t X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=323d7c62bcf24c4fbdcee790af77d87a959ffb07;p=FUZIX.git fabs: make friendly with non uint64_t --- diff --git a/Library/libs/fabs.c b/Library/libs/fabs.c index 18596239..29819bb9 100644 --- a/Library/libs/fabs.c +++ b/Library/libs/fabs.c @@ -5,9 +5,10 @@ double fabs(double x) { - union dshape u; + uint32_t hi; - u.value = x; - u.bits &= (uint64_t)-1 / 2; - return u.value; + GET_HIGH_WORD(x, hi); + hi &= 0x7FFFFFFFUL; + SET_HIGH_WORD(x, hi); + return x; }