diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-12-31 15:14:07 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-12-31 15:14:07 -0500 |
| commit | 41f92837bebae1de783dc7f4a8f880011c72757c (patch) | |
| tree | 4730711a7c13c19c135d0432be4d1fe9b34c1f77 /api/integers.md | |
| parent | 1f13fa92a87bec65d1760266b108a5485bc14c7a (diff) | |
| parent | dbae987f1fb54da795185a03f4c00d56a639f8cd (diff) | |
Merge branch 'dev' into static-dependencies
Diffstat (limited to 'api/integers.md')
| -rw-r--r-- | api/integers.md | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/api/integers.md b/api/integers.md index ef3a6a60..73779021 100644 --- a/api/integers.md +++ b/api/integers.md @@ -138,7 +138,7 @@ assert (255).hex(digits=4, uppercase=yes, prefix=yes) == "0x00FF" ## Int.is_between ```tomo -Int.is_between : func(x: Int, low: Int, high: Int -> Bool) +Int.is_between : func(x: Int, a: Int, b: Int -> Bool) ``` Determines if an integer is between two numbers (inclusive). @@ -146,15 +146,16 @@ Determines if an integer is between two numbers (inclusive). Argument | Type | Description | Default ---------|------|-------------|--------- x | `Int` | The integer to be checked. | - -low | `Int` | The lower bound to check (inclusive). | - -high | `Int` | The upper bound to check (inclusive). | - +a | `Int` | One end of the range to check (inclusive). | - +b | `Int` | 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 `a >= x and x >= b`, otherwise `no` **Example:** ```tomo assert (7).is_between(1, 10) == yes +assert (7).is_between(10, 1) == yes assert (7).is_between(100, 200) == no assert (7).is_between(1, 7) == yes |
