max
fn max<T: Ord>(T a, T b) -> T Import
Source: use num::{max}; src/num.hy Returns the larger of a and b (a when they are equal).
Parameters#
| Name | Type |
|---|---|
a | T |
b | T |
Returns#
T
Examples#
use num::{max};
use tests::assert;
assert!(max(3, 7) == 7);
See also#
abs: Returns the absolute value ofx.min: Returns the smaller 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.