Native OCaml Rego/OPA policy engine
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "ocaml-rego: relax time int64 bound to the float64 representation"

This reverts commit cff48f17b47f9e9ff97aacd9c407aaaa3b565e80.

+6 -7
+6 -7
lib/eval.ml
··· 775 775 {!Unix.gmtime} for calendar math and a small named-zone table for the 776 776 explicit-timezone overloads (the full IANA database isn't bundled). *) 777 777 778 - (** Min / max nanosecond timestamps OPA accepts. The int64 bounds round to 779 - ~9.223372036854776e18 in float64, so values outside the range start one ulp 780 - above (≈ +1024 ns away). The check is therefore not byte-exact at the 781 - boundary, but it catches values that are clearly out of range (the OPA test 782 - suite always uses such values). *) 783 - let int64_max_ns = 9.223372036854776e18 778 + (** Min / max nanosecond timestamps OPA accepts. int64 [±2^63] both round to the 779 + same float64 value (≈ ±9.223372036854776e18), so the closest float strictly 780 + inside the int64 range is the next-smaller magnitude (≈ 781 + ±9.223372036854775e18). *) 782 + let int64_min_ns = -9.223372036854775e18 784 783 785 - let int64_min_ns = -.int64_max_ns 784 + let int64_max_ns = 9.223372036854775e18 786 785 787 786 let parse_time_arg = function 788 787 | Value.Number n ->