Skip to content

int64 validation is incorrect #90

@klntsky

Description

@klntsky

// JSON and javascript max Int is 2**53, so any int that passes isInteger is valid for Int64

// JSON and javascript max Int is 2**53, so any int that passes isInteger is valid for Int64

The second part of the sentence does not follow from the first. Neither JS nor JSON do not throw on overflows.

Consider this:

> Number.isInteger(JSON.parse('' + (2 ** 65)))
true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions