I would like to know how to compare two function F(x)
& G(x)
in SML, which two functions must return the same value that f(x)==g(x)
, where 1<= x <= 100
.
For example:
- fun f x = x*x;
val f = fn : int -> int
- fun g x = x+x;
val g = fn : int -> int
- iden f g;
val it = false : bool
- fun f x = x*x;
val f = fn : int -> int
- fun g x = if x<0 then 0 else x*x;
val g = fn : int -> int
- iden f g;
val it = true : bool