PetscIntMultError#
Computes the product of two positive PetscInt
and generates an error with overflow.
Synopsis#
static inline PetscErrorCode PetscIntMultError(PetscInt a, PetscInt b, PetscInt *result)
Not Collective; No Fortran Support
Input Parameters#
a - the
PetscInt
valueb - the second value
Output Parameter#
result - the result as a
PetscInt
value, orNULL
if you do not want the result, you just want to check if it overflows
Notes#
Use PetscInt64Mult()
to compute the product of two PetscInt
and store in a PetscInt64
Use PetscIntMultTruncate()
to compute the product of two PetscInt
and truncate it to fit in a PetscInt
Developer Note#
In most places in the source code we currently assume that PetscInt
addition does not overflow, this is obviously wrong but requires many more checks.
PetscIntSumError()
can be used to check for this situation.
See Also#
PetscBLASInt
, PetscMPIInt
, PetscInt
, PetscBLASIntCast()
, PetscIntMult64()
, PetscIntSumError()
Level#
advanced
Location#
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages