mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 05:50:30 +00:00
Fixes $(0.0/0.0) giving -nan on some systems.
Squashed commit of the following: commit c7fc086b663f4d4003ccd5831a0ca508cf9badc7 Author: Dominik Picheta <dominikpicheta@gmail.com> Date: Sat Sep 17 21:09:48 2016 +0200 Another attempt at fix. commit 67b7fb67cda08d945e480a6a01fb0fee797add00 Author: Dominik Picheta <dominikpicheta@gmail.com> Date: Sat Sep 17 20:47:41 2016 +0200 Fixes $(0.0/0.0) giving `-nan` on some systems.
This commit is contained in:
@@ -292,7 +292,7 @@ proc nimFloatToStr(f: float): string {.compilerproc.} =
|
||||
buf[n+2] = '\0'
|
||||
# On Windows nice numbers like '1.#INF', '-1.#INF' or '1.#NAN' are produced.
|
||||
# We want to get rid of these here:
|
||||
if buf[n-1] == 'N':
|
||||
if buf[n-1] in {'n', 'N'}:
|
||||
result = "nan"
|
||||
elif buf[n-1] == 'F':
|
||||
if buf[0] == '-':
|
||||
|
||||
Reference in New Issue
Block a user