Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing -999999984306749440; turns into 999999984306749400 #2118

Closed
modulovalue opened this issue Aug 19, 2022 · 1 comment
Closed

Parsing -999999984306749440; turns into 999999984306749400 #2118

modulovalue opened this issue Aug 19, 2022 · 1 comment

Comments

@modulovalue
Copy link

See: https://esprima.org/demo/parse.html?code=-999999984306749440%3B

Source:

-999999984306749440;

Syntax tab:

{
  "type": "Program",
  "body": [
    {
      "type": "ExpressionStatement",
      "expression": {
        "type": "UnaryExpression",
        "operator": "-",
        "argument": {
          "type": "Literal",
          "value": 999999984306749400,
          "raw": "999999984306749440"
        },
        "prefix": true
      }
    }
  ],
  "sourceType": "script"
}

Notice how the value is not 999999984306749440 but 999999984306749400

@modulovalue
Copy link
Author

Sorry for the false alarm, I suppose that's just how JS works. :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant