aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/bignat.mli
blob: 4d45d2ba2bd4c4dff7684f8e11c10e0b55a7b989 (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
(***********************************************************************)
(*  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 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 pr_bigint : bigint -> std_ppcmds