6 signature MLTON_INT_INF =
10 val areSmall: t * t -> bool
12 val isSmall: t -> bool
14 structure BigWord : WORD
15 structure SmallInt : INTEGER
17 Big of BigWord.word vector
18 | Small of SmallInt.int
20 val fromRep : rep -> t option
24 MLton represents an arbitrary precision integer either as an unboxed
25 word with the bottom bit set to 1 and the top bits representing a
26 small signed integer, or as a pointer to a vector of words, where the
27 first word indicates the sign and the rest are the limbs of a
28 <:GnuMP:> big integer.
32 the same as type `IntInf.int`.
36 returns true iff both `a` and `b` are small.
40 uses the <:GnuMP:GnuMP's> fast gcd implementation.
44 returns true iff `a` is small.
48 representation of a big `IntInf.int` as a vector of words; on 32-bit
49 platforms, `BigWord` is likely to be equivalent to `Word32`, and on
50 64-bit platforms, `BigWord` is likely to be equivalent to `Word64`.
52 * `SmallInt : INTEGER`
54 representation of a small `IntInf.int` as a signed integer; on 32-bit
55 platforms, `SmallInt` is likely to be equivalent to `Int32`, and on
56 64-bit platforms, `SmallInt` is likely to be equivalent to `Int64`.
60 the underlying representation of an `IntInf.int`.
64 returns the underlying representation of `i`.
68 converts from the underlying representation back to an `IntInf.int`.
69 If `fromRep r` is given anything besides the valid result of `rep i`
70 for some `i`, this function call will return `NONE`.