:orphan:
# PetscIntSumError
Computes the sum of two positive `PetscInt` and generates an error with overflow. 
## Synopsis
```
static inline PetscErrorCode PetscIntSumError(PetscInt a, PetscInt b, PetscInt *result)
```
Not Collective; No Fortran Support


## Input Parameters

- ***a -*** the `PetscInt` value
- ***b -*** the second value



## Output Parameter

- ***c -*** the result as a `PetscInt` value,  or `NULL` if you do not want the result, you just want to check if it overflows





## Notes
Use `PetscInt64Mult()` to compute the product of two 32-bit `PetscInt` and store in a `PetscInt64`

Use `PetscIntMultTruncate()` to compute the product of two `PetscInt` and truncate it to fit in a `PetscInt`


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

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscsys.h.html#PetscIntSumError">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](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
