CVSROOT:        /cvs
Module name:    src
Changes by:     t...@cvs.openbsd.org    2022/08/23 00:35:53

Modified files:
        games/random   : random.6 random.c 

Log message:
Rework random(6)

Fix putchar(3) handling and a number of other issues in the random(6)
code. In -e mode, avoid bias due to truncation of the return code to
8 bits. In default mode, actually treat the denominator as a floating
point number and print the line with a probability of 1 / denominator.
This allows e.g. printing 2/3 of stdin with 'random 1.5'.

Includes code for uniform random floats by Taylor R. Campbell from
https://mumble.net/~campbell/2014/04/28/uniform-random-float
and clz64() by me.

>From lucic71 () bronze ! ctrl-c ! club, thanks.

ok deraadt

Reply via email to