min
fn min<T: Ord>(T a, T b) -> T Import
Source: use num::{min}; src/num.hy Returns the smaller of a and b (a when they are equal).
Parameters#
| Name | Type |
|---|---|
a | T |
b | T |
Returns#
T
Examples#
use num::{min};
use tests::assert;
assert!(min(3, 7) == 3);
assert!(min("pear", "apple") == "apple");
See also#
abs: Returns the absolute value ofx.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.lcm: Returns the least common multiple ofaandb, which should be non-negative;0when either is0.trunc: Removes the fractional part ofx, rounding toward zero.