shithub: riscv

Download patch

ref: 21ce34bd7fa69dfc263b2825653d10e2cbc68853
parent: 1d82e3f42aa82b12edba2e057c1a6cc090ee1c80
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat May 4 20:26:17 EDT 2019

libc: fix NaN check precedence bug in modf() (thanks BurnZeZ)

--- a/sys/src/libc/port/frexp.c
+++ b/sys/src/libc/port/frexp.c
@@ -93,7 +93,7 @@
 	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;