petsc-3.7.1 2016-05-15
Report Typos and Errors

# 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

    PETSC_STATIC_INLINE PetscInt PetscRealIntMultTruncate(PetscReal a,PetscInt b)

Not Collective Many br

### Input Parameter

| a | - the PetscReal value Many br
| b | - the second value Many br

### Output Parameter

c -the result as a PetscInt value Many br

Use PetscIntMult64bit() to compute the product of two PetscInt as a Petsc64bitInt Many brUse PetscIntMultTruncate() to compute the product of two positive PetscInt and truncate to fit a PetscInt Many brUse PetscIntMultError() to compute the product of two PetscInt if you wish to generate an error if the result will not fit in a PetscInt Many br

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

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

Many br

### 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