Skip to main content
`Ctrl`+`K`

# PETSCRANDER48

simple portable reimplementation of basic Unix `drand48()` random number generator that should generate the exact same random numbers on any system.

## Options Database Key

- -random_type (rander48|rand|rand48|sprng|random123|curand) - set the random number generator from the options database, see `PetscRandomType`.

## Notes

This is the default random number generate provided by `PetscRandomCreate()` if you do not set a particular implementation.

Each `PetscRandom` object created with this type has its own seed and its own history, so multiple `PetscRandom` objects of this type will not interfere with random numbers generated by other objects. Each PETSc object of this type will produce the exact same set of random numbers so if you wish different `PetscRandom` objects of this type set different seeds for each one after you create them with `PetscRandomSetSeed()` followed by `PetscRandomSeed()`.

## See Also

`PetscRandomCreate()`, `PetscRandomSetType()`, `PETSCRAND`, `PETSCRAND48`, `PETSCRANDER48`, `PETSCSPRNG`, `PetscRandomSetSeed()`, `PetscRandomSeed()`, `PetscRandomSetFromOptions()`

## Level

beginner

## Location

src/sys/classes/random/impls/rander48/rander48.c

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages