aboutsummaryrefslogtreecommitdiff
path: root/kernel/uint63.mli
diff options
context:
space:
mode:
authorVincent Laporte2019-07-22 12:47:53 +0000
committerVincent Laporte2019-07-22 13:02:49 +0000
commit8675b9d1a574aceb9a9d40c9c135db9c042e00b1 (patch)
treeb5f5ce6497ab70344fed0966d59ea78cf122dff9 /kernel/uint63.mli
parentc878a5e2c0c2a01512e263d3ed2dfdd8e611086f (diff)
[Int63] Implement all primitives in OCaml
Primitive operations addc, addcarryc, subc, subcarryc, and diveucl are implemented in the kernel so that they can be used by OCaml code (e.g., extracted code) as the other primitives.
Diffstat (limited to 'kernel/uint63.mli')
-rw-r--r--kernel/uint63.mli12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/uint63.mli b/kernel/uint63.mli
index 93632da110..5542716af2 100644
--- a/kernel/uint63.mli
+++ b/kernel/uint63.mli
@@ -37,6 +37,8 @@ val mul : t -> t -> t
val div : t -> t -> t
val rem : t -> t -> t
+val diveucl : t -> t -> t * t
+
(* Specific arithmetic operations *)
val mulc : t -> t -> t * t
val addmuldiv : t -> t -> t -> t
@@ -57,3 +59,13 @@ val head0 : t -> t
val tail0 : t -> t
val is_uint63 : Obj.t -> bool
+
+(* Arithmetic with explicit carries *)
+
+(* Analog of Numbers.Abstract.Cyclic.carry *)
+type 'a carry = C0 of 'a | C1 of 'a
+
+val addc : t -> t -> t carry
+val addcarryc : t -> t -> t carry
+val subc : t -> t -> t carry
+val subcarryc : t -> t -> t carry