:orphan: # 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 ifort -fpe0 ``` ## See Also `PetscFPTrapPop()`, `PetscSetFPTrap()`, `PetscDetermineInitialFPTrap()` ## Level advanced ## Location src/sys/error/fp.c ## Examples src/ksp/ksp/tutorials/ex59.c
--- [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](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)