summary refs log tree commit diff stats
path: root/lib/system/sysstr.nim
diff options
context:
space:
mode:
authorParashurama <Rhagdamaziel@ymail.com>2016-05-25 11:57:09 +0200
committerParashurama <Rhagdamaziel@ymail.com>2016-05-25 11:57:09 +0200
commit4716034a7f438b3324d1d6d930f994668180f7ea (patch)
tree872821d4752a9a2234d5f83b6d27863f9f0fc823 /lib/system/sysstr.nim
parentad70fb4ffeb91f1cb847705f41ffaf3c2aefb67c (diff)
downloadNim-4716034a7f438b3324d1d6d930f994668180f7ea.tar.gz
fixes issue 4212 && add test for various valid zero floats.
Diffstat (limited to 'lib/system/sysstr.nim')
-rw-r--r--lib/system/sysstr.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/system/sysstr.nim b/lib/system/sysstr.nim
index 50adca480..74fcfd8c5 100644
--- a/lib/system/sysstr.nim
+++ b/lib/system/sysstr.nim
@@ -387,8 +387,8 @@ proc nimParseBiggestFloat(s: string, number: var BiggestFloat,
 
   # if has no digits: return error
   if kdigits + fdigits <= 0 and
-     (i == start or # was only zero
-      has_sign) :   # or only '+' or '-
+     (i == start or # no char consumed (empty string).
+     (i == start + 1 and has_sign)): # or only '+' or '-
     return 0
 
   if s[i] in {'e', 'E'}: