aboutsummaryrefslogtreecommitdiff
path: root/api/integers.yaml
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-12-31 15:13:32 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-12-31 15:13:32 -0500
commitdbae987f1fb54da795185a03f4c00d56a639f8cd (patch)
tree40a4d00c045c29cd9af117aa01194b8c8be4fbeb /api/integers.yaml
parent0f9af5f44bd2735f34a48ceb177837a5a6ef25b0 (diff)
Changed is_between() to be bidirectional
Diffstat (limited to 'api/integers.yaml')
-rw-r--r--api/integers.yaml11
1 files changed, 6 insertions, 5 deletions
diff --git a/api/integers.yaml b/api/integers.yaml
index b3c6b579..bbbd395d 100644
--- a/api/integers.yaml
+++ b/api/integers.yaml
@@ -146,22 +146,23 @@ Int.is_between:
return:
type: 'Bool'
description: >
- `yes` if `low <= x and x <= high`, otherwise `no`
+ `yes` if `a <= x and x <= b` or `a >= x and x >= b`, otherwise `no`
args:
x:
type: 'Int'
description: >
The integer to be checked.
- low:
+ a:
type: 'Int'
description: >
- The lower bound to check (inclusive).
- high:
+ One end of the range to check (inclusive).
+ b:
type: 'Int'
description: >
- The upper bound to check (inclusive).
+ The other end of the range to check (inclusive).
example: |
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