LeastCommonMultiple¶
Get the least common multiple of x and y where both x and y >= 1.
Providing 0 or numbers that overflow the integer width will result in an error.
Example usage:
use "math"
actor Main
new create(env: Env) =>
try
let lcm = LeastCommonMultiple[U64](10, 20)?
env.out.print(lcm.string())
else
env.out.print("No LCM")
end
Constructors¶
create¶
Returns¶
- LeastCommonMultiple val^
Public Functions¶
apply[A: (Integer[A] val & (U8 val | U16 val | U32 val | U64 val | U128 val | ULong val | USize val))]¶
fun box apply[A: (Integer[A] val & (U8 val | U16 val | U32 val |
U64 val | U128 val | ULong val |
USize val))](
x: A,
y: A)
: A ?
Parameters¶
- x: A
- y: A
Returns¶
- A ?
eq¶
Parameters¶
- that: LeastCommonMultiple val
Returns¶
- Bool val
ne¶
Parameters¶
- that: LeastCommonMultiple val
Returns¶
- Bool val