Function in num coil-stdlib

min

fn min<T: Ord>(T a, T b) -> T
Import
use num::{min};
Source: src/num.hy

Returns the smaller of a and b (a when they are equal).

Parameters#

NameType
aT
bT

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 of x.
  • max: Returns the larger of a and b (a when they are equal).
  • round: Rounds x to the nearest whole number; halves round away from zero.
  • clamp: Returns x limited to the range lo..=hi.
  • signum: Returns -1, 0 or 1 by the sign of x.
  • gcd: Returns the greatest common divisor of a and b, which should be non-negative.
  • lcm: Returns the least common multiple of a and b, which should be non-negative; 0 when either is 0.
  • trunc: Removes the fractional part of x, rounding toward zero.
↑ ↓ navigate ↵ open