Docs
This commit is contained in:
1 parent
5ce2215e44
commit
6a62ae58fc
22 files changed
+670
-7
No files matched your search
@@ -1,5 +1,11 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Constrain integer to interval `[min,max]`
|
||||
*
|
||||
* @param int $min lower bound
|
||||
* @param int $max upper bound
|
||||
*/
|
||||
function constrain(int $min, int $max, $n): int
|
||||
{
|
||||
return max(min($max, $n), $min);
|
||||
|
||||
Reference in new issue
Block a user