changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: libc: fix NaN check precedence bug in modf() (thanks BurnZeZ)

changeset 7204: d41b5fcde5ce
parent 7203: b7549703c62f
child 7205: 3aeef7e94ea9
author: cinap_lenrek@felloff.net
date: Sun, 05 May 2019 00:26:17 +0200
files: sys/src/libc/port/frexp.c
description: libc: fix NaN check precedence bug in modf() (thanks BurnZeZ)
     1.1--- a/sys/src/libc/port/frexp.c
     1.2+++ b/sys/src/libc/port/frexp.c
     1.3@@ -93,7 +93,7 @@ modf(double d, double *ip)
     1.4 	e = (x.hi >> SHIFT) & MASK;
     1.5 	if(e == MASK){
     1.6 		*ip = d;
     1.7-		if(x.lo != 0 || (x.hi & 0xfffffL != 0))	/* NaN */
     1.8+		if(x.lo != 0 || (x.hi & 0xfffffL) != 0)	/* NaN */
     1.9 			return d;
    1.10 		/* ┬▒Inf */
    1.11 		x.hi &= 0x80000000L;