random: don't assume random-bytes is a byte-vector
It's not anymore.
parent
16fe44008a
commit
027fc77c36
|
|
@ -96,8 +96,8 @@ ERROR: too-many-samples seq n ;
|
||||||
secure-random-generator get swap with-random ; inline
|
secure-random-generator get swap with-random ; inline
|
||||||
|
|
||||||
: uniform-random-float ( min max -- n )
|
: uniform-random-float ( min max -- n )
|
||||||
4 random-bytes underlying>> uint deref >float
|
4 random-bytes uint deref >float
|
||||||
4 random-bytes underlying>> uint deref >float
|
4 random-bytes uint deref >float
|
||||||
2.0 32 ^ * +
|
2.0 32 ^ * +
|
||||||
[ over - 2.0 -64 ^ * ] dip
|
[ over - 2.0 -64 ^ * ] dip
|
||||||
* + ; inline
|
* + ; inline
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue