#!/bin/lua -- code below shows usage example for fraction library "frac.lua". Fr=require("frac").Fr x=Fr.new(2,3) y=Fr.new(3,5) print("with x y",x,y) print("__add x+y",x+y) print("__add 1+y",1+y) print("__add x+1",x+1) print("__sub x-y",x-y) print("__sub 1-y",1-y) print("__sub x-1",x-1) print("__mul x*y",x*y) print("__mul 1*y",1*y) print("__mul x*1",x*1) print("__div x/y",x/y) print("__div 1/x",1/x) print("__div x/1",x/1) print("__unm -x",-x) print("__eq x==y", x==y) print("__eq x==y", x==x) print("__lt xy",x>y) print("__le x<=y",x<=y) print("__le x>=y",x>=y) print("x[1],x[2]",x[1],x[2])