Fixed a bug in float deserialization.

* fixes #124
This commit is contained in:
Felix Krause 2022-09-07 16:54:11 +02:00
parent 7942e0a650
commit 3e2f92c753
1 changed files with 6 additions and 2 deletions

View File

@ -297,9 +297,13 @@ proc constructObject*[T: float|float32|float64](
let hint = guessType(item.scalarContent)
case hint
of yTypeFloat:
discard parseBiggestFloat(item.scalarContent, result)
var res: BiggestFloat
discard parseBiggestFloat(item.scalarContent, res)
result = res
of yTypeInteger:
discard parseBiggestFloat(item.scalarContent, result)
var res: BiggestFloat
discard parseBiggestFloat(item.scalarContent, res)
result = res
of yTypeFloatInf:
if item.scalarContent[0] == '-': result = NegInf
else: result = Inf