MLton 20051202 MLtonIntInf
Home  Index  
signature MLTON_INT_INF =
   sig
      type t

      val areSmall: t * t -> bool
      val gcd: t * t -> t
      val isSmall: t -> bool
      datatype rep =
         Big of word vector
       | Small of int
      val rep: t -> rep
   end

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


Last edited on 2005-12-02 03:46:17 by MatthewFluet.