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

Marshal: precision diff with stdjson on float32 #21

Closed
littleRa1n opened this issue Jun 18, 2021 · 1 comment
Closed

Marshal: precision diff with stdjson on float32 #21

littleRa1n opened this issue Jun 18, 2021 · 1 comment
Labels
wontfix This will not be worked on

Comments

@littleRa1n
Copy link

example code:
f := map[string]float32{
"value": 0.006072998046875,
}

b1, _ := json.Marshal(f)
b2, _ := sonic.Marshal(f)

fmt.Println(string(b1))
fmt.Println(string(b2))

@AsterDY
Copy link
Collaborator

AsterDY commented Jun 18, 2021

Since it's not a precision loss and json RFC suggests to use float64, we think it is unnecessary to handle this at present

@AsterDY AsterDY closed this as completed Jun 21, 2021
@chenzhuoyu chenzhuoyu added the wontfix This will not be worked on label Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants