# PetscIntSumTruncate
Computes the sum of two positive `PetscInt` and truncates the value to slightly less than the maximal possible value 
## Synopsis
```
static inline PetscInt PetscIntSumTruncate(PetscInt a, PetscInt b)
```
Not Collective


## Input Parameters

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



## Returns
the result as a `PetscInt` value

Use `PetscInt64Mult()` to compute the product of two `PetscInt` as a `PetscInt64`
Use `PetscRealIntMultTruncate()` to compute the product of a `PetscReal` and a `PetscInt` and truncate to fit a `PetscInt`
Use `PetscIntMultError()` to compute the product of two `PetscInt` if you wish to generate an error if the result will not fit in a `PetscInt`

This is used where we compute approximate sizes for workspace and need to insure the workspace is index-able.

Not available from Fortran




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

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscsys.h.html#PetscIntSumTruncate">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)  
