diff options
Diffstat (limited to 'api/floats.md')
| -rw-r--r-- | api/floats.md | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/api/floats.md b/api/floats.md index 69097bfd..a6d78b78 100644 --- a/api/floats.md +++ b/api/floats.md @@ -574,15 +574,16 @@ Determines if a number is between two numbers (inclusive). Argument | Type | Description | Default ---------|------|-------------|--------- x | `Float` | The integer to be checked. | - -low | `Float` | The lower bound to check (inclusive). | - -high | `Float` | The upper bound to check (inclusive). | - +low | `Num` | One end of the range to check (inclusive). | - +high | `Num` | The other end of the range to check (inclusive). | - -**Return:** `yes` if `low <= x and x <= high`, otherwise `no` +**Return:** `yes` if `a <= x and x <= b` or `b <= x and x <= a`, otherwise `no` **Example:** ```tomo assert (7.5).is_between(1, 10) == yes +assert (7.5).is_between(10, 1) == yes assert (7.5).is_between(100, 200) == no assert (7.5).is_between(1, 7.5) == yes |
