Public Member Functions | Protected Attributes | List of all members
ana::FloatingExceptionOnNaN Class Reference

Alter floating-point exception flag. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-25/CAFAna/Core/Utilities.h"

Public Member Functions

 FloatingExceptionOnNaN (bool enable=true)
 
 ~FloatingExceptionOnNaN ()
 

Protected Attributes

fexcept_t fBackup
 

Detailed Description

Alter floating-point exception flag.

Upon going out of scope, restores the previous setting

Definition at line 59 of file Utilities.h.

Constructor & Destructor Documentation

ana::FloatingExceptionOnNaN::FloatingExceptionOnNaN ( bool  enable = true)

Definition at line 64 of file Utilities.cxx.

References ana::DontAddDirectory::fBackup.

65  {
66  // Don't want any pending FPEs to trigger when we flip exceptions
67  // on. Whoever had them off previously had a reason.
68  feclearexcept(FE_INVALID);
69 
70  fegetexceptflag(&fBackup, FE_INVALID);
71 
72  if(enable)
73  feenableexcept(FE_INVALID);
74  else
75  fedisableexcept(FE_INVALID);
76  }
ana::FloatingExceptionOnNaN::~FloatingExceptionOnNaN ( )

Definition at line 79 of file Utilities.cxx.

References ana::DontAddDirectory::fBackup.

80  {
81  fesetexceptflag(&fBackup, FE_INVALID);
82  }

Member Data Documentation

fexcept_t ana::FloatingExceptionOnNaN::fBackup
protected

Definition at line 65 of file Utilities.h.


The documentation for this class was generated from the following files: