-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
This code makes the exception:
let str = "10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
let data = str.data(using: .utf8)!
let decoder = CleanJSONDecoder()
do {
let value = try decoder.decode(Double.self, from: data)
print("OK = \(value)")
} catch {
print("Error = \(error)")
}
If you remove one of zeroes in "str" then the decoding will be OK. So the limit is 1e165, after which the decoding fails regardless of Double type can really fit.
Metadata
Metadata
Assignees
Labels
No labels