fix negative nan (#16628)
This commit is contained in:
parent
5897ed9d3d
commit
be6e8916fa
3 changed files with 29 additions and 5 deletions
|
|
@ -2485,7 +2485,10 @@ proc gen(p: PProc, n: PNode, r: var TCompRes) =
|
|||
let f = n.floatVal
|
||||
case classify(f)
|
||||
of fcNan:
|
||||
r.res = rope"NaN"
|
||||
if signbit(f):
|
||||
r.res = rope"-NaN"
|
||||
else:
|
||||
r.res = rope"NaN"
|
||||
of fcNegZero:
|
||||
r.res = rope"-0.0"
|
||||
of fcZero:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue