# PetscFPTrapPush
push a floating point trapping mode, restored using `PetscFPTrapPop()` 
## Synopsis
```
#include "petscsys.h"  
PetscErrorCode PetscFPTrapPush(PetscFPTrap trap)
```
Not Collective


## Input Parameter

- ***trap -*** `PETSC_FP_TRAP_ON` or `PETSC_FP_TRAP_OFF` or any of the values passable to `PetscSetFPTrap()`





## Notes
This only changes the trapping if the new mode is different than the current mode.

This routine is called to turn off trapping for certain LAPACK routines that assume that dividing
by zero is acceptable. In particular the routine ieeeck().

Most systems by default have all trapping turned off, but certain Fortran compilers have
link flags that turn on trapping before the program begins.
```none
gfortran -ffpe-trap=invalid,zero,overflow,underflow,denormal
```
```none
ifort -fpe0
```


## See Also
 `PetscFPTrapPop()`, `PetscSetFPTrap()`, `PetscDetermineInitialFPTrap()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/error/fp.c.html#PetscFPTrapPush">src/sys/error/fp.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex59.c.html">src/ksp/ksp/tutorials/ex59.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/error/fp.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
