aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/bignat.mli
blob: ca2b0fff6b8999b292caadde7f14a0f330134ea0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
(***********************************************************************)
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team    *)
(* <O___,, *        INRIA-Rocquencourt  &  LRI-CNRS-Orsay              *)
(*   \VV/  *************************************************************)
(*    //   *      This file is distributed under the terms of the      *)
(*         *       GNU Lesser General Public License Version 2.1       *)
(***********************************************************************)

(* $Id$ *)

(*i*)
open Pp
(*i*)

(* Arbitrary big natural numbers *)

type bignat

val of_string : string -> bignat
val to_string : bignat -> string

val is_nonzero : bignat -> bool
val zero : bignat
val one : bignat
val is_one : bignat -> bool
val div2_with_rest : bignat -> bignat * bool (* true=odd; false=even *)

val add_1 : bignat -> bignat
val sub_1 : bignat -> bignat (* Remark: (sub_1 0)=0 *)
val mult_2 : bignat -> bignat

val less_than : bignat -> bignat -> bool

type bigint = POS of bignat | NEG of bignat

val bigint_to_string : bigint -> string
val pr_bigint : bigint -> std_ppcmds