databricks / sjsonnet

Apache License 2.0
266 stars 54 forks source link

Rounding of large numbers inconsistent with google/jsonnet #186

Open lihaoyi opened 1 year ago

lihaoyi commented 1 year ago

Input: 738529527931269425

It seems this is mostly an issue in the pretty-printing of floats: JS rounds a bit more than Java does, but in the end both are valid representations for the same double, and are bit-for-bit-identical and are == to each other on both Java and JS.

databricks/sjsonnet is meant to be identical to google/jsonnet, so even if this is an edge case we should probably follow suit

Initially reported in https://github.com/com-lihaoyi/upickle/issues/522