From b56595ae26d64f316a1c4a473b7fe98cf0719127 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Sat, 17 Sep 2016 22:02:17 +0200 Subject: [PATCH] Fixes $(0.0/0.0) giving `-nan` on some systems. Squashed commit of the following: commit c7fc086b663f4d4003ccd5831a0ca508cf9badc7 Author: Dominik Picheta Date: Sat Sep 17 21:09:48 2016 +0200 Another attempt at fix. commit 67b7fb67cda08d945e480a6a01fb0fee797add00 Author: Dominik Picheta Date: Sat Sep 17 20:47:41 2016 +0200 Fixes $(0.0/0.0) giving `-nan` on some systems. --- lib/system/sysstr.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/system/sysstr.nim b/lib/system/sysstr.nim index eb3d276e0..3e170172b 100644 --- a/lib/system/sysstr.nim +++ b/lib/system/sysstr.nim @@ -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] == '-':