Файловый менеджер - Редактировать - /home/kckglobal/public_html/portal/vendor/azjezz/psl/src/Psl/Math/clamp.php
Назад
<?php declare(strict_types=1); namespace Psl\Math; /** * Returns the given number clamped to the given range. * * @template T of float|int * * @param T $number * @param T $min * @param T $max * * @throws Exception\InvalidArgumentException If $min is bigger than $max * * @return T * * @pure */ function clamp(int|float $number, int|float $min, int|float $max): int|float { if ($max < $min) { throw new Exception\InvalidArgumentException('Expected $min to be lower or equal to $max.'); } if ($number < $min) { return $min; } if ($number > $max) { return $max; } return $number; }
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка