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

"Inf" and "+Inf" in Super JSON #5392

Open
philrz opened this issue Oct 30, 2024 · 0 comments
Open

"Inf" and "+Inf" in Super JSON #5392

philrz opened this issue Oct 30, 2024 · 0 comments

Comments

@philrz
Copy link
Contributor

philrz commented Oct 30, 2024

tl;dr

At the moment the Super JSON spec indicates that both Inf and +Inf are ways to express "positive infinity", but only +Inf currently works. In the review comments of #5386 @mccanne expressed:

Regarding Inf, in IEEE floating point, there's a +Inf and a -Inf. I think we should have one way to represent +Inf in Super JSON and we could change +Inf to Inf. I think we went with +Inf because the golang fmt library prints it that way.

Details

Repro is with super commit 49b1add.

When working on docs updates in #5386, I noticed that only +Inf seems to be working at the moment.

$ super -version
Version: v1.18.0-71-g49b1addb

$ echo '1 +Inf 2' | super -z -c 'yield typeof(this)' -
<int64>
<float64>
<int64>

$ echo '1 Inf 2' | super -z -c 'yield typeof(this)' -
stdio:stdin: Super JSON syntax error

When we fix this we can make sure the Super JSON spec is updated to reflect the final state.

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

No branches or pull requests

1 participant