source: Deliverables/D2.2/8051/src/utilities/integer.mli @ 486

Last change on this file since 486 was 486, checked in by ayache, 8 years ago

Deliverable D2.2

File size: 1.7 KB
Line 
1(* Pasted from Pottier's PP compiler *)
2
3(** This module provides access to several of the operations defined
4    in Objective Caml's standard library module [Int32], under the
5    names usually reserved for operations on integers of type
6    [int]. This allows switching from 31- or 63-bit arithmetic to
7    32-bit arithmetic. *)
8
9val (+): int32 -> int32 -> int32
10val (-): int32 -> int32 -> int32
11val ( * ): int32 -> int32 -> int32
12val (/): int32 -> int32 -> int32
13val (mod): int32 -> int32 -> int32
14val (land): int32 -> int32 -> int32
15val (lor): int32 -> int32 -> int32
16val (lxor): int32 -> int32 -> int32
17val (lsl): int32 -> int -> int32
18val (asr): int32 -> int -> int32
19val (lsr): int32 -> int -> int32
20val (<=): int32 -> int32 -> bool
21val (<): int32 -> int32 -> bool
22val (>=): int32 -> int32 -> bool
23val (>): int32 -> int32 -> bool
24val (~-): int32 -> int32
25val max: int32 -> int32 -> int32
26
27val max_int: int32
28val min_int: int32
29
30(* ------------------------------------------------------------------------- *)
31(* Here are some extra operations. *)
32
33(* [fits16 i] tells whether [i] fits in 16 bits, that is, whether it
34   lies within the range [-2^15 .. 2^15 - 1]. *)
35
36val fits16: int32 -> bool
37
38(* [is_power_of_two i] tells whether [i] is a positive power of 2. In
39   that case, [log2 i] is its logarithm. [exp2 i] is two to the [i]. *)
40
41val is_power_of_two: int32 -> bool
42val log2: int32 -> int32
43val exp2: int32 -> int32
44
45(* ------------------------------------------------------------------------- *)
46(* Here are some operations on arrays with 32-bit indices. *)
47
48module Array : sig
49
50  val make: int32 -> 'a -> 'a array
51  val init: int32 -> (int32 -> 'a) -> 'a array
52  val get: 'a array -> int32 -> 'a
53  val set: 'a array -> int32 -> 'a -> unit
54  val length: 'a array -> int32
55
56end
Note: See TracBrowser for help on using the repository browser.