2017-01-04 17:16:58 -05:00
|
|
|
USING: kernel layouts literals math math.cardinality
|
|
|
|
math.functions random sequences tools.test ;
|
|
|
|
|
|
|
|
${ fixnum-bits } [ 0 trailing-zeros ] unit-test
|
|
|
|
{ 0 } [ 0b1 trailing-zeros ] unit-test
|
|
|
|
{ 1 } [ 0b10 trailing-zeros ] unit-test
|
|
|
|
{ 2 } [ 0b100 trailing-zeros ] unit-test
|
|
|
|
{ 3 } [ 0b1000 trailing-zeros ] unit-test
|
|
|
|
|
|
|
|
{ t } [
|
|
|
|
10 [
|
|
|
|
10,000 [ random-units 10 estimate-cardinality ] [ / ] bi
|
2017-01-05 12:06:33 -05:00
|
|
|
] replicate [ 1.0 0.15 ~ ] all? ! should be 4%?
|
2017-01-04 17:16:58 -05:00
|
|
|
] unit-test
|