:orphan:
# PetscRealIntMultTruncate
Computes the product of a positive `PetscReal` and a positive `PetscInt` and truncates the value to slightly less than the maximal possible value. 
## Synopsis
```
static inline PetscInt PetscRealIntMultTruncate(PetscReal a, PetscInt b)
```
Not Collective; No Fortran Support


## Input Parameters

- ***a -*** The `PetscReal` value
- ***b -*** The `PetscInt` value





## Notes
Returns the result as a `PetscInt` value.

Use `PetscInt64Mult()` to compute the product of two `PetscInt` as a `PetscInt64`.

Use `PetscIntMultTruncate()` to compute the product of two positive `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`.


## Developers Notes
We currently assume that `PetscInt` addition can never overflow, this is obviously wrong but
requires many more checks.

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


## See Also
 `PetscReal`, `PetscInt`, `PetscInt64Mult()`, `PetscIntMultError()`, `PetscIntSumError()`

## Level
advanced

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