Merge pull request #4216 from Parashurama/fix_4212
fixes issue 4212 && add test for various valid zero floats.
This commit is contained in:
commit
ea0dff3783
2 changed files with 23 additions and 15 deletions
|
|
@ -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'}:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue