output of json encode/decode of structs containing f64 arrays is not equivalent to the input #22860
Labels
Bug
This tag is applied to issues which reports bugs.
Modules: JSON
Bugs/feature requests, that are related to `json` and `x.json2` modules.
Status: Confirmed
This bug has been confirmed to be valid by a contributor.
Describe the bug
Applying json.encode and then json.decode to a struct containing an f64 array generates an output which is no longer equivalent to the input.
It appears to be related to how and where rounding is done.
Reproduction Steps
Expected Behavior
the input should be equivalent to the output
Current Behavior
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.4.8 df51e84, timestamp: 2024-11-14 13:58:50 +0200
Environment details (OS name and version, etc.)
V full version: V 0.4.8 dad8e3c.df51e84
OS: macos, macOS, 15.0.1, 24A348
Processor: 16 cpus, 64bit, little endian, Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
getwd: /Users/henryolders
vexe: /Users/henryolders/v/v
vexe mtime: 2024-11-14 15:14:24
vroot: OK, value: /Users/henryolders/v
VMODULES: OK, value: /Users/henryolders/.vmodules
VTMP: OK, value: /tmp/v_507
env VFLAGS: "-use-os-system-to-run"
Git version: git version 2.47.0
Git vroot status: weekly.2024.06-1635-gdf51e840
.git/config present: true
CC version: Apple clang version 16.0.0 (clang-1600.0.26.4)
emcc version: N/A
thirdparty/tcc status: thirdparty-macos-amd64 975f1ad8
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: