# PetscRandomGetType
Gets the type name (as a string) from the `PetscRandom`. 
## Synopsis
```
#include "petscsys.h" 
PetscErrorCode PetscRandomGetType(PetscRandom rnd, PetscRandomType *type)
```
Not Collective


## Input Parameter

- ***rnd  -*** The random number generator context



## Output Parameter

- ***type -*** The type name





## See Also
 `PetscRandom`, `PetscRandomSetType()`, `PetscRandomCreate()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/random/interface/randreg.c.html#PetscRandomGetType">src/sys/classes/random/interface/randreg.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/random/interface/randreg.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
