You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
struct Response: Codable {
let success: Bool
let value: Double
}
func testJASON() {
let string: String =
"""
{"success":true,"value":100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000≥0}
"""
let data = string.data(using: .utf8)!
let json = JASON.JSON(data)
let val = json["value"].double
print("\(val)")
}
If you remove one of zeroes in "string" then the decoding will be OK. So the limit is 1e165, after which the decoding fails regardless of Double type can really fit.
The text was updated successfully, but these errors were encountered:
This code makes the exception:
If you remove one of zeroes in "string" then the decoding will be OK. So the limit is 1e165, after which the decoding fails regardless of Double type can really fit.
The text was updated successfully, but these errors were encountered: