-
Notifications
You must be signed in to change notification settings - Fork 564
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
Number
loses precision on f32s
#1004
Labels
Comments
Gelbpunkt
changed the title
Mar 27, 2023
Number
loses precision on floatsNumber
loses precision on f32s
Good catch, this is a bug. |
crapStone
added a commit
to Calciumdibromid/CaBr2
that referenced
this issue
Mar 30, 2023
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [serde_json](https://github.com/serde-rs/json) | dependencies | patch | `1.0.94` -> `1.0.95` | --- ### Release Notes <details> <summary>serde-rs/json</summary> ### [`v1.0.95`](https://github.com/serde-rs/json/releases/tag/v1.0.95) [Compare Source](serde-rs/json@v1.0.94...v1.0.95) - Preserve f32 precision when serializing f32 -> serde_json::Value -> JSON string in "arbitrary_precision" mode ([#​1004](serde-rs/json#1004), [#​1005](serde-rs/json#1005)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4yNC41IiwidXBkYXRlZEluVmVyIjoiMzUuMjQuNiJ9--> Co-authored-by: cabr2-bot <cabr2.help@gmail.com> Co-authored-by: crapStone <crapstone01@gmail.com> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1835 Reviewed-by: crapStone <crapstone@noreply.codeberg.org> Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org> Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there, I've gone through a couple of issues but haven't found anything that quite matches my problem, so if this is a duplicate, feel free to close this and direct me elsewhere :)
The following small snippet replicates my issue:
I would expect the serialized values to be identical (and serialized to 5.55), but they aren't. This happens both with and without
arbitrary_precision
andfloat_roundtrip
enabled. I would've expected this to be precisely 5.55, especially witharbitrary_precision
enabled. When changing the type to anf64
, it works as expected.The text was updated successfully, but these errors were encountered: