cleanup docs and tests (#16235)

* js module also uses runnableExamples

* cleanup docs and tests
This commit is contained in:
flywind 2020-12-04 05:59:17 +08:00 • committed by GitHub
commit e4e5a0c65a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View file

@ -253,7 +253,7 @@ proc clamp*[T](x, a, b: T): T =
## Limits the value `x` within the interval [a, b].
## This proc is equivalent to but fatser than `max(a, min(b, x))`.
##
## **Note:** `a < b` is assumed and will not be checked.
## **Note:** `a <= b` is assumed and will not be checked.
runnableExamples:
assert (1.4).clamp(0.0, 1.0) == 1.0
assert (0.5).clamp(0.0, 1.0) == 0.5