Added math.clamp for slice clamping (#17246)

* Added math.clamp for slice clamping

* Added inline to math.clamp

* Cleaned up math.clamp + test
This commit is contained in:
Jason Beetham 2021-03-03 16:54:23 -07:00 • committed by GitHub
commit c180de60a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 0 deletions

View file

@ -22,6 +22,8 @@
- Added `almostEqual` in `math` for comparing two float values using a machine epsilon.
- Added `clamp` in `math` which allows using a `Slice` to clamp to a value.
- The JSON module can now handle integer literals and floating point literals of
arbitrary length and precision.
Numbers that do not fit the underlying `BiggestInt` or `BiggestFloat` fields are