google / google/go-jsonnet

Numeric calculations in go-jsonnet and cpp-jsonnet produce (slightly) different numbers

Open
#449 10 comments 0 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
Go
Stars
1.8k
Forks
263
PR merge metrics
No merged PRs in 30d

Description

I've found some cases where go-jsonnet doesn't match jsonnet.

C++ jsonnet:
```
$ ./jsonnet -e "36.557601928710938 + std.cos(2 * 3.14159265358979323846264338327950288 / 32 * 15) * 2"
34.596031367904473
$ ./jsonnet -e "38.19 + std.cos(2 * 3.14159265358979323846264338327950288 / 32 * 15) * 2"
36.228429439193533
```

go-jsonnet:
```
$ ./jsonnet -e "36.557601928710938 + std.cos(2 * 3.14159265358979323846264338327950288 / 32 * 15) * 2"
34.59603136790448
$ ./jsonnet -e "38.19 + std.cos(2 * 3.14159265358979323846264338327950288 / 32 * 15) * 2"
36.22842943919354
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.