From 21ce34bd7fa69dfc263b2825653d10e2cbc68853 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 5 May 2019 00:26:17 +0200 Subject: libc: fix NaN check precedence bug in modf() (thanks BurnZeZ) --- sys/src/libc/port/frexp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/src/libc/port/frexp.c b/sys/src/libc/port/frexp.c index e2f4fb072..51ba57e5a 100644 --- a/sys/src/libc/port/frexp.c +++ b/sys/src/libc/port/frexp.c @@ -93,7 +93,7 @@ modf(double d, double *ip) e = (x.hi >> SHIFT) & MASK; if(e == MASK){ *ip = d; - if(x.lo != 0 || (x.hi & 0xfffffL != 0)) /* NaN */ + if(x.lo != 0 || (x.hi & 0xfffffL) != 0) /* NaN */ return d; /* ±Inf */ x.hi &= 0x80000000L; -- cgit v1.2.3