aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-11-03 22:45:49 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-11-03 22:45:49 -0500
commit81a180eda0efda86256b4aa2f8f6caecac3a9151 (patch)
tree7e7b63f4114fc4e16835bbf6ade41ff752eb3c44
parentd0ebb66b30a723db9c0c6d9a57877b84e7dff386 (diff)
RNG seed should be non-optional
-rw-r--r--docs/rng.md2
-rw-r--r--environment.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/docs/rng.md b/docs/rng.md
index 9d1c94d3..c680196e 100644
--- a/docs/rng.md
+++ b/docs/rng.md
@@ -172,7 +172,7 @@ Return a new random number generator.
**Signature:**
```tomo
-func new(seed: [Byte] = (/dev/urandom):read_bytes(40) -> RNG)
+func new(seed: [Byte] = (/dev/urandom):read_bytes(40)! -> RNG)
```
**Parameters:**
diff --git a/environment.c b/environment.c
index 113eff1d..39e50b02 100644
--- a/environment.c
+++ b/environment.c
@@ -355,7 +355,7 @@ env_t *new_compilation_unit(CORD libname)
{"int32", "RNG$int32", "func(rng:RNG, min=Int32.min, max=Int32.max -> Int32)"},
{"int64", "RNG$int64", "func(rng:RNG, min=Int64.min, max=Int64.max -> Int64)"},
{"int8", "RNG$int8", "func(rng:RNG, min=Int8.min, max=Int8.max -> Int8)"},
- {"new", "RNG$new", "func(seed=(/dev/urandom):read_bytes(40) -> RNG)"},
+ {"new", "RNG$new", "func(seed=(/dev/urandom):read_bytes(40)! -> RNG)"},
{"num", "RNG$num", "func(rng:RNG, min=0.0, max=1.0 -> Num)"},
{"num32", "RNG$num32", "func(rng:RNG, min=0.0_f32, max=1.0_f32 -> Num32)"},
{"set_seed", "RNG$set_seed", "func(rng:RNG, seed:[Byte])"},