summaryrefslogtreecommitdiff
path: root/lib/bigint.mli
blob: 9a89057099abedea5e1a213ee20296eaaf9af04d (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
38
39
40
41
42
43
44
45
46
47
(************************************************************************)
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
(* <O___,, *   INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2011     *)
(*   \VV/  **************************************************************)
(*    //   *      This file is distributed under the terms of the       *)
(*         *       GNU Lesser General Public License Version 2.1        *)
(************************************************************************)

(*i $Id: bigint.mli 14641 2011-11-06 11:59:10Z herbelin $ i*)

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

(* Arbitrary large integer numbers *)

type bigint

val of_string : string -> bigint
val to_string : bigint -> string

val zero : bigint
val one : bigint
val two : bigint

val div2_with_rest : bigint -> bigint * bool (* true=odd; false=even *)
val add_1 : bigint -> bigint
val sub_1 : bigint -> bigint
val mult_2 : bigint -> bigint

val add : bigint -> bigint -> bigint
val sub : bigint -> bigint -> bigint
val mult : bigint -> bigint -> bigint
val euclid : bigint -> bigint -> bigint * bigint

val less_than : bigint -> bigint -> bool
val equal : bigint -> bigint -> bool

val is_strictly_pos : bigint -> bool
val is_strictly_neg : bigint -> bool
val is_pos_or_zero : bigint -> bool
val is_neg_or_zero : bigint -> bool
val neg : bigint -> bigint

val pow : bigint -> bigint -> bigint

val pr_bigint : bigint -> std_ppcmds