Native OCaml Rego/OPA policy engine
0
fork

Configure Feed

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

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

+7 -6
+7 -6
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. 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 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 783 784 784 - let int64_max_ns = 9.223372036854775e18 785 + let int64_min_ns = -.int64_max_ns 785 786 786 787 let parse_time_arg = function 787 788 | Value.Number n ->