fixes issue 4212 && add test for various valid zero floats.

This commit is contained in:
Parashurama 2016-05-25 11:57:09 +02:00
commit 4716034a7f
2 changed files with 23 additions and 15 deletions

View file

@ -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'}: