diff options
| author | Guillaume Melquiond | 2020-12-01 21:03:18 +0100 |
|---|---|---|
| committer | Guillaume Melquiond | 2020-12-02 07:33:24 +0100 |
| commit | 2422d7dee3fda9ac5e65636db937d3d98c85e576 (patch) | |
| tree | 5eaa572121e6eeb12ed4160fcb46fc5f94c82274 /kernel/uint63_31.ml | |
| parent | 9ca7e769b62173a79a1c7d12a363205dd608b519 (diff) | |
Greatly simplify the conversion functions between Z.t and Uint63.t.
Diffstat (limited to 'kernel/uint63_31.ml')
| -rw-r--r-- | kernel/uint63_31.ml | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/kernel/uint63_31.ml b/kernel/uint63_31.ml index 696efacb32..3517f51bfc 100644 --- a/kernel/uint63_31.ml +++ b/kernel/uint63_31.ml @@ -26,6 +26,7 @@ let mask63 i = Int64.logand i maxuint63 let of_int i = Int64.of_int i let to_int2 i = (Int64.to_int (Int64.shift_right_logical i 31), Int64.to_int i) let of_int64 i = i +let to_int64 i = i let to_int_min n m = if Int64.(compare n (of_int m)) < 0 then Int64.to_int n else m @@ -41,13 +42,6 @@ let hash i = (* conversion of an uint63 to a string *) let to_string i = Int64.to_string i -let of_string s = - let i64 = Int64.of_string s in - if Int64.compare Int64.zero i64 <= 0 - && Int64.compare i64 maxuint63 <= 0 - then i64 - else raise (Failure "Int63.of_string") - (* Compiles an unsigned int to OCaml code *) let compile i = Printf.sprintf "Uint63.of_int64 (%LiL)" i |
