summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@gmail.com>2016-09-17 22:02:17 +0200
committerDominik Picheta <dominikpicheta@gmail.com>2016-09-17 22:09:10 +0200
commitb56595ae26d64f316a1c4a473b7fe98cf0719127 (patch)
treee72880166027a353a13914bda0d7e41b76da0189
parent93160547a92064e82ff070298b320b3c3abe8dbd (diff)
downloadNim-b56595ae26d64f316a1c4a473b7fe98cf0719127.tar.gz
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.
-rw-r--r--lib/system/sysstr.nim2
1 files changed, 1 insertions, 1 deletions
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] == '-':