petsc-3.10.5 2019-03-28
Report Typos and Errors


Computes the product of a positive PetscReal and a positive PetscInt and truncates the value to slightly less than the maximal possible value


PETSC_STATIC_INLINE PetscInt PetscRealIntMultTruncate(PetscReal a,PetscInt b)
Not Collective

Input Parameter

a - the PetscReal value
b - the second value


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 Note

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.

Not available from Fortran

See Also

PetscBLASInt, PetscMPIInt, PetscInt, PetscBLASIntCast(), PetscInt64Mult()




Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages