diff --git a/testdata/builtin_atan.golden b/testdata/builtin_atan.golden index f445930..43acef3 100644 --- a/testdata/builtin_atan.golden +++ b/testdata/builtin_atan.golden @@ -1 +1 @@ -0.78539816339744828 +"0.785398163397448" diff --git a/testdata/builtin_atan.jsonnet b/testdata/builtin_atan.jsonnet index 36c2013..a8f2e03 100644 --- a/testdata/builtin_atan.jsonnet +++ b/testdata/builtin_atan.jsonnet @@ -1 +1,2 @@ -std.atan(1) +local tolerance = (import 'tolerance.libsonnet').tolerance; +tolerance(std.atan(1)) diff --git a/testdata/builtin_tan.golden b/testdata/builtin_tan.golden index df7ba92..f5ec57a 100644 --- a/testdata/builtin_tan.golden +++ b/testdata/builtin_tan.golden @@ -1 +1 @@ -1.5574077246549021 +"1.557407724654902" diff --git a/testdata/builtin_tan.jsonnet b/testdata/builtin_tan.jsonnet index c45322d..dfcb3ba 100644 --- a/testdata/builtin_tan.jsonnet +++ b/testdata/builtin_tan.jsonnet @@ -1 +1,2 @@ -std.tan(1) +local tolerance = (import 'tolerance.libsonnet').tolerance; +tolerance(std.tan(1)) diff --git a/testdata/pow5.golden b/testdata/pow5.golden index 065bb28..a3c69b0 100644 --- a/testdata/pow5.golden +++ b/testdata/pow5.golden @@ -1 +1 @@ -1.1486983549970351 +"1.148698354997035" diff --git a/testdata/pow5.jsonnet b/testdata/pow5.jsonnet index d1230be..bc7dd04 100644 --- a/testdata/pow5.jsonnet +++ b/testdata/pow5.jsonnet @@ -1 +1,2 @@ -std.pow(2, 0.2) +local tolerance = (import 'tolerance.libsonnet').tolerance; +tolerance(std.pow(2, 0.2)) diff --git a/testdata/tolerance.libsonnet b/testdata/tolerance.libsonnet new file mode 100644 index 0000000..2f4920d --- /dev/null +++ b/testdata/tolerance.libsonnet @@ -0,0 +1,7 @@ +{ + // Formats a floating point number to get 15 digits + // after the decimal point. It is used for some tests + // of numeric functions, where a range of values is + // acceptable, due to differences in cpu architecture. + tolerance(x):: "%.15f" % x +}