function BigNumber::min
Returns the minimum of the given values.
@psalm-pure
Parameters
BigNumber|int|float|string ...$values The numbers to compare. All the numbers need to be convertible: to an instance of the class this method is called on.
Throws
\InvalidArgumentException If no values are given.
MathException If an argument is not valid.
File
-
vendor/
brick/ math/ src/ BigNumber.php, line 216
Class
- BigNumber
- Common interface for arbitrary-precision rational numbers.
Namespace
Brick\MathCode
public static final function min(BigNumber|int|float|string ...$values) : static {
$min = null;
foreach ($values as $value) {
$value = static::of($value);
if ($min === null || $value->isLessThan($min)) {
$min = $value;
}
}
if ($min === null) {
throw new \InvalidArgumentException(__METHOD__ . '() expects at least one value.');
}
return $min;
}