swift-json icon indicating copy to clipboard operation
swift-json copied to clipboard

`JSON.Node(parsing:)` throws an error when a fractional number is too long

Open rgoldberg opened this issue 10 months ago • 0 comments

JSON.Node(parsing:) throws UnexpectedValueError() when a fractional number is too long, when, ignoring the decimal point, it cannot fit inside UInt64:

// Error
[1.00000000000000000000]

// No error
[1.0000000000000000000]

My code parses JSON provided by a third-party, so I cannot change the format. The fractional values I receive aren't all zero; I just wanted to indicate that the problem occurs even when the factional part could be dropped without any loss of precision.

rgoldberg avatar Jan 14 '25 15:01 rgoldberg