Portability | Good |
---|---|

Stability | experimental |

Maintainer | Vincent Hanquez <vincent@snarc.org> |

Safe Haskell | None |

- generateMax :: CPRG g => g -> Integer -> (Integer, g)
- generateBetween :: CPRG g => g -> Integer -> Integer -> (Integer, g)
- generateOfSize :: CPRG g => g -> Int -> (Integer, g)

# Documentation

generateMax :: CPRG g => g -> Integer -> (Integer, g)Source

generate a positive integer between 0 and m. using as many bytes as necessary to the same size as m, that are converted to integer.

generateBetween :: CPRG g => g -> Integer -> Integer -> (Integer, g)Source

generate a number between the inclusive bound [low,high].

generateOfSize :: CPRG g => g -> Int -> (Integer, g)Source

generate a positive integer of a specific size in bits. the number of bits need to be multiple of 8. It will always returns an integer that is close to 2^(1+bits/8) by setting the 2 highest bits to 1.