GreatestCommonDivisor¶
Get greatest common divisor of x and y.
Providing 0 will result in an error.
Example usage:
use "math"
actor Main
new create(env: Env) =>
try
let gcd = GreatestCommonDivisor[I64](10, 20)?
env.out.print(gcd.string())
else
env.out.print("No GCD")
end
Constructors¶
create¶
Returns¶
Public Functions¶
apply[A: Integer[A] val]¶
Parameters¶
- x: A
- y: A
Returns¶
- A ?
eq¶
Parameters¶
- that: GreatestCommonDivisor val
Returns¶
- Bool val
ne¶
Parameters¶
- that: GreatestCommonDivisor val
Returns¶
- Bool val