diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-12-31 15:13:32 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-12-31 15:13:32 -0500 |
| commit | dbae987f1fb54da795185a03f4c00d56a639f8cd (patch) | |
| tree | 40a4d00c045c29cd9af117aa01194b8c8be4fbeb /man/man3/tomo-Int.is_between.3 | |
| parent | 0f9af5f44bd2735f34a48ceb177837a5a6ef25b0 (diff) | |
Changed is_between() to be bidirectional
Diffstat (limited to 'man/man3/tomo-Int.is_between.3')
| -rw-r--r-- | man/man3/tomo-Int.is_between.3 | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/man/man3/tomo-Int.is_between.3 b/man/man3/tomo-Int.is_between.3 index 8087e0d0..fd54eb41 100644 --- a/man/man3/tomo-Int.is_between.3 +++ b/man/man3/tomo-Int.is_between.3 @@ -2,14 +2,14 @@ .\" Copyright (c) 2025 Bruce Hill .\" All rights reserved. .\" -.TH Int.is_between 3 2025-11-29 "Tomo man-pages" +.TH Int.is_between 3 2025-12-31 "Tomo man-pages" .SH NAME Int.is_between \- test if an int is in a range .SH LIBRARY Tomo Standard Library .SH SYNOPSIS .nf -.BI Int.is_between\ :\ func(x:\ Int,\ low:\ Int,\ high:\ Int\ ->\ Bool) +.BI Int.is_between\ :\ func(x:\ Int,\ a:\ Int,\ b:\ Int\ ->\ Bool) .fi .SH DESCRIPTION Determines if an integer is between two numbers (inclusive). @@ -23,15 +23,16 @@ lb lb lbx l l l. Name Type Description 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). .TE .SH RETURN -`yes` if `low <= x and x <= high`, otherwise `no` +`yes` if `a <= x and x <= b` or `a >= x and x >= b`, otherwise `no` .SH EXAMPLES .EX 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 .EE |
