aboutsummaryrefslogtreecommitdiff
path: root/man
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 /man
parent0f9af5f44bd2735f34a48ceb177837a5a6ef25b0 (diff)
Changed is_between() to be bidirectional
Diffstat (limited to 'man')
-rw-r--r--man/man3/tomo-Byte.is_between.39
-rw-r--r--man/man3/tomo-Int.34
-rw-r--r--man/man3/tomo-Int.is_between.311
-rw-r--r--man/man3/tomo-Num.is_between.39
4 files changed, 18 insertions, 15 deletions
diff --git a/man/man3/tomo-Byte.is_between.3 b/man/man3/tomo-Byte.is_between.3
index 06e53fb0..3b539ea1 100644
--- a/man/man3/tomo-Byte.is_between.3
+++ b/man/man3/tomo-Byte.is_between.3
@@ -2,7 +2,7 @@
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
-.TH Byte.is_between 3 2025-11-29 "Tomo man-pages"
+.TH Byte.is_between 3 2025-12-31 "Tomo man-pages"
.SH NAME
Byte.is_between \- test if inside a range
.SH LIBRARY
@@ -23,15 +23,16 @@ lb lb lbx
l l l.
Name Type Description
x Byte The integer to be checked.
-low Byte The lower bound to check (inclusive).
-high Byte The upper bound to check (inclusive).
+low Byte One end of the range to check (inclusive);
+high Byte 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 `b <= x and x <= a`, otherwise `no`
.SH EXAMPLES
.EX
assert Byte(7).is_between(1, 10) == yes
+assert Byte(7).is_between(10, 1) == yes
assert Byte(7).is_between(100, 200) == no
assert Byte(7).is_between(1, 7) == yes
.EE
diff --git a/man/man3/tomo-Int.3 b/man/man3/tomo-Int.3
index 186c0aae..64ae7bf6 100644
--- a/man/man3/tomo-Int.3
+++ b/man/man3/tomo-Int.3
@@ -2,7 +2,7 @@
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
-.TH Int 3 2025-11-30 "Tomo man-pages"
+.TH Int 3 2025-12-31 "Tomo man-pages"
.SH NAME
Int \- a Tomo type
.SH LIBRARY
@@ -59,7 +59,7 @@ For more, see:
.TP
-.BI Int.is_between\ :\ func(x:\ Int,\ low:\ Int,\ high:\ Int\ ->\ Bool)
+.BI Int.is_between\ :\ func(x:\ Int,\ a:\ Int,\ b:\ Int\ ->\ Bool)
Determines if an integer is between two numbers (inclusive).
For more, see:
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
diff --git a/man/man3/tomo-Num.is_between.3 b/man/man3/tomo-Num.is_between.3
index 4276c8e3..ea78d895 100644
--- a/man/man3/tomo-Num.is_between.3
+++ b/man/man3/tomo-Num.is_between.3
@@ -2,7 +2,7 @@
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
-.TH Num.is_between 3 2025-11-29 "Tomo man-pages"
+.TH Num.is_between 3 2025-12-31 "Tomo man-pages"
.SH NAME
Num.is_between \- check if a number is in a range
.SH LIBRARY
@@ -23,15 +23,16 @@ lb lb lbx
l l l.
Name Type Description
x Num The integer to be checked.
-low Num The lower bound to check (inclusive).
-high Num 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).
.TE
.SH RETURN
-`yes` if `low <= x and x <= high`, otherwise `no`
+`yes` if `a <= x and x <= b` or `b <= x and x <= a`, otherwise `no`
.SH EXAMPLES
.EX
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
.EE