This commit is contained in:
parent
5a49ff86db
commit
79311e786e
1 changed files with 0 additions and 8 deletions
|
@ -2,14 +2,6 @@ import math, random, strutils
|
|||
|
||||
export math
|
||||
|
||||
proc clamp*(n, min, max: float32): float32 =
|
||||
## Clamps n to min, else returns max if n is higher.
|
||||
if n < min:
|
||||
return min
|
||||
if n > max:
|
||||
return max
|
||||
return n
|
||||
|
||||
proc between*(value, min, max: float32): bool =
|
||||
## Returns true if value is between min and max or equal to them.
|
||||
(value >= min) and (value <= max)
|
||||
|
|
Loading…
Reference in a new issue