Num; add min, max and clamp

This commit is contained in:
ruby0x1
2020-12-03 13:18:13 -08:00
parent 38f50fe091
commit 8361217369
4 changed files with 52 additions and 0 deletions

View File

@ -116,6 +116,20 @@ The binary (base-2) logarithm of the number. Returns `nan` if the base is negati
The exponential `e` (Eulers number) raised to the number. This: `eⁿ`.
### **min**(other)
Returns the minimum value when comparing this number and `other`.
### **max**(other)
Returns the maximum value when comparing this number and `other`.
### **clamp**(min, max)
Clamps a number into the range of `min` and `max`. If this number is less than min,
`min` is returned. If bigger than `max`, `max` is returned. Otherwise, the number
itself is returned.
### **pow**(power)
Raises this number (the base) to `power`. Returns `nan` if the base is negative.