From ca2e1e1fce0a0be8eaba23c1255c8f106732980b Mon Sep 17 00:00:00 2001 From: Sorawee Porncharoenwase Date: Mon, 5 Feb 2024 05:17:09 -0800 Subject: [PATCH] doc: pseudo-random-generator-next! can't return 0.0 According to the code of `S_random_state_next_double` at https://github.com/cisco/ChezScheme/blob/1f5adec2c18712c89eb1692458fcf5d6514bff42/c/random.c#L108-L109 (which is invoked by `pseudo-random-generator-next!`), the value is in the range (inclusively) 1 / (m1 + 1) to m1 / (m1 + 1). Therefore, 0.0 cannot be the result. --- csug/numeric.stex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/csug/numeric.stex b/csug/numeric.stex index 9f2263f8f..4865118f9 100644 --- a/csug/numeric.stex +++ b/csug/numeric.stex @@ -1506,8 +1506,8 @@ Checks whether \var{val} is a pseudo-random generator state. provided, it must be a positive, exact integer. Steps a pseudo-random generator to produce a number. The result is an -inexact number between \scheme{0.0} (inclusive) and \scheme{1.0} -(exclusive) if \var{below-int} is not provided. If \scheme{below-int} is +inexact number between \scheme{0.0} and \scheme{1.0} +(both exclusive) if \var{below-int} is not provided. If \scheme{below-int} is provided, the result is an exact integer between \scheme{0} (inclusive) and \scheme{below-int} (exclusive).