aboutsummaryrefslogtreecommitdiff
path: root/stdlib/bytes.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-11-03 22:37:48 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-11-03 22:37:48 -0500
commitfc9a6f1416be514e9d26b301d05e7e347560560b (patch)
tree7d61cc3657c36dde05135f17dbf5923cff177abf /stdlib/bytes.c
parent52e3d3fe6f2c3e5051affe155fed364d1a5d623c (diff)
Add RNGs to the language
Diffstat (limited to 'stdlib/bytes.c')
-rw-r--r--stdlib/bytes.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/stdlib/bytes.c b/stdlib/bytes.c
index f7e90576..8d665790 100644
--- a/stdlib/bytes.c
+++ b/stdlib/bytes.c
@@ -17,17 +17,6 @@ PUREFUNC public Text_t Byte$as_text(const Byte_t *b, bool colorize, const TypeIn
return Text$format(colorize ? "\x1b[35m%u[B]\x1b[m" : "%u[B]", *b);
}
-public Byte_t Byte$random(Byte_t min, Byte_t max)
-{
- if (min > max)
- fail("Random minimum value (%u) is larger than the maximum value (%u)", min, max);
- if (min == max)
- return min;
-
- uint32_t r = arc4random_uniform((uint32_t)max - (uint32_t)min + 1u);
- return (Byte_t)(min + r);
-}
-
public const TypeInfo_t Byte$info = {
.size=sizeof(Byte_t),
.align=__alignof__(Byte_t),