petsc-3.7.3 2016-08-01
Report Typos and Errors

PetscIntMultError

Computes the product of two positive PetscInt and generates an error with overflow.

Synopsis

PETSC_STATIC_INLINE PetscErrorCode PetscIntMultError(PetscInt a,PetscInt b,PetscInt *result)
Not Collective

Input Parameter

a - the PetscInt value
b - the second value

Output Parameter:ma

c -the result as a PetscInt value

Use PetscIntMult64bit() to compute the product of two 32 bit PetscInt and store in a Petsc64bitInt Use PetscIntMultTruncate() to compute the product of two PetscInt and truncate it to fit in a PetscInt

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

See Also

PetscBLASInt, PetscMPIInt, PetscInt, PetscBLASIntCast(), PetscIntMult64()

Level:advanced
Location:
include/petscsys.h
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages