cisco / ChezScheme

Chez Scheme
Apache License 2.0
6.89k stars 983 forks source link

doc: pseudo-random-generator-next! can't return 0.0 #803

Closed sorawee closed 5 months ago

sorawee commented 5 months ago

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.