123456789101112131415161718192021222324252627typegenexternalcreate_extern_gen_bits:string->(unit->int)->gen="caml_unif01_CreateExternGenBits"letcreate_extern_gen_bitsnamebits=(* Add a test that the [bits] function does not provide more than 30, in which
case they would be lost. Doing the test every time does not have any real
impact on the performances. *)create_extern_gen_bitsname(fun()->letb=bits()inifblsr30<>0theninvalid_arg"more than 30 bits received";b)externalcreate_extern_gen_int32:string->(unit->int32)->gen="caml_unif01_CreateExternGenInt32"externalcreate_extern_gen_01:string->(unit->float)->gen="caml_unif01_CreateExternGen01"letcreate_extern_gen_01namebits=(* Add a test that the [bits] function provides a float in [0, 1). The
contrary could provoke segmentation faults in certain tests. Doing the test
every time does not have any real impact on the performances. *)create_extern_gen_01name(fun()->letb=bits()inifb<0.||b>=1.theninvalid_arg"float outside of [0, 1) received";b)