From 323d7c62bcf24c4fbdcee790af77d87a959ffb07 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 5 Mar 2018 20:27:07 +0000 Subject: [PATCH] fabs: make friendly with non uint64_t --- Library/libs/fabs.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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; } -- 2.34.1