This commit is contained in:
swrup 2025-10-13 04:15:58 +02:00
parent e37802e9dc
commit 959ccc1d1f
2 changed files with 10 additions and 5 deletions

View file

@ -17,8 +17,9 @@ type t = {
fraction: Int64.t;
}
let ( let* ) o f = match o with Ok v -> f v | Error _ as e -> e
let make ~sign ~currency ~value ~fraction =
let open Syntax in
let value_upper_bound = Z.(pow (of_int 2) 52) |> Z.to_int64 in
let fraction_upper_bound = Int64.of_int 99_999_999 in
let* () = if value < Int64.zero then Error "value is negative" else Ok () in