Definition of the Floating Point Environment

With the following function you get the actual environment settings

  Int_t result=gSystem->GetFPEMask();
  cout <<"Exception result: " << result <<endl;

The following command set the environment variable and returns the old status
  Int_t result=gSystem->SetFPEMask(kNoneMask);
  cout <<"Exception result: " << result <<endl;

The following values are possible

enum EFpeMask {
   kNoneMask         = 0x00,  // In any error the result of the wrong
                                 operation is NaN
   kInvalid          = 0x01,  // Invalid argument
   kDivByZero        = 0x02,  // Division by zero
   kOverflow         = 0x04,  // Overflow
   kUnderflow        = 0x08,  // Underflow
   kInexact          = 0x10,  // Inexact
   kDefaultMask      = 0x07,  // Invalid + Overflow + Division by zero
   kAllMask          = 0x1F   // Error in all cases
};

The new value has to be set after all libraries are loaded. If this is done before the setting is lost and the default setting is valid. That means if one wants to switch from the default value to any other setting then this has to be done in each macro after loading the libraries.

-- FlorianUhlig - 14 Dec 2007
Topic revision: r1 - 2007-12-14, FlorianUhlig
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding CBM Wiki? Send feedback
Imprint (in German)
Privacy Policy (in German)