Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

biginteger.rand

Generate a random number


Description

Generate a uniformly distributed random number in the range 0 to 2^size - 1, inclusive.

Usage

urand.bigz(nb=1,size=200, seed = 0)

Arguments

nb

Integer: number of random numbers to be generated (size of vector returned)

size

Integer: number will be generated in the range 0 to 2^size - 1

seed

Bigz: random seed initialisation

Value

A biginteger of class bigz.

Author(s)

Antoine Lucas

References

mpz\_urandomb from the GMP Library, see https://gmplib.org

Examples

# Integers are differents
urand.bigz()
urand.bigz()
urand.bigz()

# Integers are the same
urand.bigz(seed="234234234324323")
urand.bigz(seed="234234234324323")

# Vector
urand.bigz(nb=50,size=30)

gmp

Multiple Precision Arithmetic

v0.6-2
GPL (>= 2)
Authors
Antoine Lucas, Immanuel Scholz, Rainer Boehme <rb-gmp@reflex-studio.de>, Sylvain Jasson <Sylvain.Jasson@inrae.fr>, Martin Maechler <maechler@stat.math.ethz.ch>
Initial release
2021-01-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.