MLton 20070826 MLtonIntInf
Home  Index  
signature MLTON_INT_INF =
   sig
      type t = IntInf.int

      val areSmall: t * t -> bool
      val gcd: t * t -> t
      val isSmall: t -> bool

      structure BigWord : WORD
      structure SmallInt : INTEGER
      datatype rep =
         Big of BigWord.word vector
       | Small of SmallInt.int
      val rep: t -> rep
   end

MLton represents an arbitrary precision integer either as an unboxed word with the bottom bit set to 1 and the top bits representing a small signed integer, or as a pointer to a vector of words, where the first word indicates the sign and the rest are the limbs of a GnuMP big integer.


Last edited on 2007-08-23 13:54:34 by MatthewFluet.