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

JSON serialization not working for Infinity #1840

Closed
josdejong opened this issue May 3, 2020 · 1 comment
Closed

JSON serialization not working for Infinity #1840

josdejong opened this issue May 3, 2020 · 1 comment

Comments

@josdejong
Copy link
Owner

When serializing a number which is Infinity, the information is lost:

JSON.stringify(Infinity) // "null"

Expected behavior: the serialization should somehow serialize these special numeric values, so they can be revived correctly:

const aOriginal = Infinity
const stringified = JSON.stringify(aOriginal)
const aRevived = JSON.parse(stringified, math.json.reviver)// is null, should be Infinity
assert.strictEqual(aOriginal, aRevived) // is false, should be true

Ref: #27 (comment)

@josdejong
Copy link
Owner Author

Closing in favor of #1834, which I hadn't seen...

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

No branches or pull requests

1 participant