-
-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Labels
bugSomething isn't workingSomething isn't working
Description
There is currently a subtle bug in Thoth.Json (since for ever probably), where number with decimal set to 0 like 10.0 or 2120.0 are considered integral value.
This is because in JavaScript the test we use is:
function isIntegral(value) {
return isFinite(value) && Math.floor(value) === value;
}
// Returns
isIntegral(10.0) // ❌
isIntegral(2120.0) // ❌
isIntegral(10.1) // ✅Case marked with ❌ are incorrect because they return true instead of false.
This means that 10.0 is consider a valid number for int16, etc.
This bug is not present in Thoth.Json.Newtonsoft, neither in Thoth.Json.Python.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working