lcm
fn lcm(int a, int b) -> int Import
Source: use num::{lcm}; src/num.hy Returns the least common multiple of a and b, which should be non-negative; 0 when either is 0.
Parameters#
| Name | Type |
|---|---|
a | int |
b | int |
Returns#
int
Examples#
use num::{lcm};
use tests::assert;
assert!(lcm(4, 6) == 12);
See also#
abs: Returns the absolute value ofx.min: Returns the smaller ofaandb(awhen they are equal).max: Returns the larger ofaandb(awhen they are equal).round: Roundsxto the nearest whole number; halves round away from zero.clamp: Returnsxlimited to the rangelo..=hi.signum: Returns-1,0or1by the sign ofx.gcd: Returns the greatest common divisor ofaandb, which should be non-negative.trunc: Removes the fractional part ofx, rounding toward zero.