# PetscIntCast
casts a `PetscInt64` (which is 64 bits in size) to a `PetscInt` (which may be 32 bits in size), generates an error if the `PetscInt` is not large enough to hold the number. 
## Synopsis
```
static inline PetscErrorCode PetscIntCast(PetscInt64 a, PetscInt *b)
```
Not Collective


## Input Parameter

- ***a -*** the `PetscInt64` value



## Output Parameter

- ***b -*** the resulting `PetscInt` value





## Notes
If integers needed for the applications are too large to fit in 32 bit ints you can ./configure using --with-64-bit-indices to make `PetscInt` use 64 bit ints

Not available from Fortran


## See Also
 `PetscBLASInt`, `PetscMPIInt`, `PetscInt`, `PetscMPIIntCast()`, `PetscBLASIntCast()`, `PetscIntMultError()`, `PetscIntSumError()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscsys.h.html#PetscIntCast">include/petscsys.h</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscsys.h)


[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)  
