[486] | 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 | |
---|
| 9 | val (+): int32 -> int32 -> int32 |
---|
| 10 | val (-): int32 -> int32 -> int32 |
---|
| 11 | val ( * ): int32 -> int32 -> int32 |
---|
| 12 | val (/): int32 -> int32 -> int32 |
---|
| 13 | val (mod): int32 -> int32 -> int32 |
---|
| 14 | val (land): int32 -> int32 -> int32 |
---|
| 15 | val (lor): int32 -> int32 -> int32 |
---|
| 16 | val (lxor): int32 -> int32 -> int32 |
---|
| 17 | val (lsl): int32 -> int -> int32 |
---|
| 18 | val (asr): int32 -> int -> int32 |
---|
| 19 | val (lsr): int32 -> int -> int32 |
---|
| 20 | val (<=): int32 -> int32 -> bool |
---|
| 21 | val (<): int32 -> int32 -> bool |
---|
| 22 | val (>=): int32 -> int32 -> bool |
---|
| 23 | val (>): int32 -> int32 -> bool |
---|
| 24 | val (~-): int32 -> int32 |
---|
| 25 | val max: int32 -> int32 -> int32 |
---|
| 26 | |
---|
| 27 | val max_int: int32 |
---|
| 28 | val 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 | |
---|
| 36 | val 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 | |
---|
| 41 | val is_power_of_two: int32 -> bool |
---|
| 42 | val log2: int32 -> int32 |
---|
| 43 | val exp2: int32 -> int32 |
---|
| 44 | |
---|
| 45 | (* ------------------------------------------------------------------------- *) |
---|
| 46 | (* Here are some operations on arrays with 32-bit indices. *) |
---|
| 47 | |
---|
| 48 | module 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 | |
---|
| 56 | end |
---|