From 2422d7dee3fda9ac5e65636db937d3d98c85e576 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Tue, 1 Dec 2020 21:03:18 +0100 Subject: Greatly simplify the conversion functions between Z.t and Uint63.t. --- kernel/uint63_63.ml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'kernel/uint63_63.ml') diff --git a/kernel/uint63_63.ml b/kernel/uint63_63.ml index 21f57e2bfb..8d052d6593 100644 --- a/kernel/uint63_63.ml +++ b/kernel/uint63_63.ml @@ -25,7 +25,8 @@ let of_int i = i let to_int2 i = (0,i) -let of_int64 _i = assert false +let of_int64 = Int64.to_int +let to_int64 = to_uint64 let of_float = int_of_float @@ -39,13 +40,6 @@ let hash i = i (* conversion of an uint63 to a string *) let to_string i = Int64.to_string (to_uint64 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 Int64.to_int i64 - else raise (Failure "Int64.of_string") - (* Compiles an unsigned int to OCaml code *) let compile i = Printf.sprintf "Uint63.of_int (%i)" i -- cgit v1.2.3