new library arith.mlw: arithmetic for programs

parent 4e6f7b18
(* Arithmetic for programs *)
module Int
use export int.Int
use export int.ComputerDivision
let (/) (x: int) (y:int) = { y <> 0 } div x y { result = div x y }
end
(* machine arithmetic (32-bit integers, etc.) will go here *)
module Real
use import real.Real
use export real.RealInfix
use export real.FromInt
let (/.) (x: real) (y: real) = { y <> 0. } x / y { result = x / y }
end
(*
Local Variables:
compile-command: "unset LANG; make -C .. modules/arith"
End:
*)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment