mirror of
https://github.com/dlang/phobos.git
synced 2025-04-29 22:50:38 +03:00
std.algo.cmp.clamp
* Returns and Params for clamp another fix quickfur review fixes underscore
This commit is contained in:
parent
eba63621c6
commit
fbf42b4b73
1 changed files with 13 additions and 4 deletions
|
@ -475,10 +475,19 @@ unittest
|
|||
)());
|
||||
}
|
||||
|
||||
/**
|
||||
Returns $(D val), if it is between $(D lower) and $(D upper).
|
||||
Otherwise returns the nearest of the two. Equivalent to $(D max(lower,
|
||||
min(upper,val))).
|
||||
/** Clamps a value into the given bounds.
|
||||
|
||||
This functions is equivalent to $(D max(lower, min(upper,val))).
|
||||
|
||||
Params:
|
||||
val = The value to _clamp.
|
||||
lower = The _lower bound of the _clamp.
|
||||
upper = The _upper bound of the _clamp.
|
||||
|
||||
Returns:
|
||||
Returns $(D val), if it is between $(D lower) and $(D upper).
|
||||
Otherwise returns the nearest of the two.
|
||||
|
||||
*/
|
||||
auto clamp(T1, T2, T3)(T1 val, T2 lower, T3 upper)
|
||||
in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue