src/Tools/integer.ML
changeset 23298 404988d8b1e0
parent 23251 471b576aad25
child 23517 93d1ad7662a9
equal deleted inserted replaced
23297:06f108974fa1 23298:404988d8b1e0
     5 Unbounded integers.
     5 Unbounded integers.
     6 *)
     6 *)
     7 
     7 
     8 signature INTEGER =
     8 signature INTEGER =
     9 sig
     9 sig
    10   type int
    10   eqtype int
    11   val zero: int
    11   val zero: int
    12   val one: int
    12   val one: int
    13   val two: int
    13   val two: int
    14   val int: Int.int -> int
    14   val int: Int.int -> int
    15   val machine_int: int -> Int.int
    15   val machine_int: int -> Int.int
    96 end;
    96 end;
    97 
    97 
    98 type integer = Integer.int;
    98 type integer = Integer.int;
    99 
    99 
   100 infix 7 *%;
   100 infix 7 *%;
   101 infix 6 +% -%; 
   101 infix 6 +% -%;
   102 infix 4 =% <% <=% >% >=% <>%;
   102 infix 4 =% <% <=% >% >=% <>%;
   103 
   103 
   104 fun a +% b = Integer.add a b;
   104 fun a +% b = Integer.add a b;
   105 fun a -% b = a +% Integer.neg b;
   105 fun a -% b = Integer.sub a b;
   106 fun a *% b = Integer.mult a b;
   106 fun a *% b = Integer.mult a b;
   107 fun a =% b = Integer.eq (a, b);
   107 fun a =% b = Integer.eq (a, b);
   108 fun a <% b = Integer.lt a b;
   108 fun a <% b = Integer.lt a b;
   109 fun a <=% b = Integer.le a b;
   109 fun a <=% b = Integer.le a b;
   110 fun a >% b = b <% a;
   110 fun a >% b = b <% a;
   111 fun a >=% b = b <=% a;
   111 fun a >=% b = b <=% a;
   112 fun a <>% b = not (a =% b);
   112 fun a <>% b = not (a =% b);
   113 
   113 
   114 structure Intt = Integer; (*FIXME*)
       
   115 val gcd = uncurry Integer.gcd; (*FIXME*)
   114 val gcd = uncurry Integer.gcd; (*FIXME*)
   116 val lcm = uncurry Integer.lcm; (*FIXME*)
   115 val lcm = uncurry Integer.lcm; (*FIXME*)