Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

SAMRAI::tbox::IEEE Struct Reference

#include <source/toolbox/base/IEEE.h>

List of all members.

Static Public Member Functions

static void setupExceptionHandlers ()
static float getSignalingFloatNaN ()
static double getSignalingNaN ()
static int getINT_MAX ()
static int getINT_MIN ()
static float getFLT_MAX ()
static float getFLT_MIN ()
static float getFLT_EPSILON ()
static double getDBL_MAX ()
static double getDBL_MIN ()
static double getDBL_EPSILON ()
static void setNaN (float &f)
static void setNaN (double &d)
static void initializeArrayToSignalingNaN (Array< float > &data)
static void initializeArrayToSignalingNaN (Array< double > &data)
static void initializeArrayToINT_MAX (Array< int > &data)
static void initializeArrayToINT_MIN (Array< int > &data)
static void initializeArrayToFLT_MAX (Array< float > &data)
static void initializeArrayToFLT_MIN (Array< float > &data)
static void initializeArrayToDBL_MAX (Array< double > &data)
static void initializeArrayToDBL_MIN (Array< double > &data)
static void initializeArrayToSignalingNaN (float *data, const int n=1)
static void initializeArrayToSignalingNaN (double *data, const int n=1)
static void initializeArrayToINT_MAX (int *data, const int n=1)
static void initializeArrayToINT_MIN (int *data, const int n=1)
static void initializeArrayToFLT_MAX (float *data, const int n=1)
static void initializeArrayToFLT_MIN (float *data, const int n=1)
static void initializeArrayToDBL_MAX (double *data, const int n=1)
static void initializeArrayToDBL_MIN (double *data, const int n=1)
static bool isNaN (const float &f)
static bool isNaN (const double &d)


Detailed Description

Class IEEE is a utility for managing IEEE trap handlers and the initialization of data to signaling NaNs, and for managing Posix constants like INT_MAX, FLT_MAX, DBL_MAX, etc. Signaling NaNs force a trap if they are used in a numerical operation, so they are a useful way to track uninitialized floating point data. Signaling NaN's may only be used for double and float data. Setting integer values to INT_MAX is a useful way to track uninitialized integer values.

The implementation of this class depends heavily on the particular computer architecture and how it implements floating point arithmetic and hardware traps. Unfortunately, there is no POSIX/IEEE standard on how to manage the traps generated by floating point calculations.


Member Function Documentation

void SAMRAI::tbox::IEEE::setupExceptionHandlers  )  [static]
 

Set up IEEE exception handlers so that normal IEEE exceptions will cause a program abort. This is useful for tracking down errors. Note, however, that this may cause problems if your code relies on IEEE underflow or overflow traps.

float SAMRAI::tbox::IEEE::getSignalingFloatNaN  )  [inline, static]
 

Get the IEEE float signaling NaN on architectures that support it. Using this value in a numerical expression will cause a program abort.

double SAMRAI::tbox::IEEE::getSignalingNaN  )  [inline, static]
 

Get the IEEE double signaling NaN on architectures that support it. Using this value in a numerical expression will cause a program abort.

int SAMRAI::tbox::IEEE::getINT_MAX  )  [inline, static]
 

Get max int - INT_MAX (may be compiler dependent; typical value is 2147483647).

int SAMRAI::tbox::IEEE::getINT_MIN  )  [inline, static]
 

Get min int - INT_MIN (may be compiler dependent; typical value is -2147483648).

float SAMRAI::tbox::IEEE::getFLT_MAX  )  [inline, static]
 

Get max float - FLT_MAX (may be compiler dependent; typical value is 3.40282e+38).

float SAMRAI::tbox::IEEE::getFLT_MIN  )  [inline, static]
 

Get min float - FLT_MIN (may be compiler dependent; typical value is 1.17549e-38).

float SAMRAI::tbox::IEEE::getFLT_EPSILON  )  [inline, static]
 

Get epsilon for float - FLT_EPSILON (may be compiler dependent; typical value is 1.19209e-07).

double SAMRAI::tbox::IEEE::getDBL_MAX  )  [inline, static]
 

Get max double - DBL_MAX (may be compiler dependent; typical value is 1.79769e+308).

double SAMRAI::tbox::IEEE::getDBL_MIN  )  [inline, static]
 

Get min double - DBL_MIN (may be compiler dependent; typical value is 2.22507e-308).

double SAMRAI::tbox::IEEE::getDBL_EPSILON  )  [inline, static]
 

Get epsilon for double - DBL_EPSILON (may be compiler dependent; typical value is 2.22045e-16).

void SAMRAI::tbox::IEEE::setNaN float &  f  )  [static]
 

Set supplied value to the signaling NaN.

void SAMRAI::tbox::IEEE::setNaN double &  d  )  [static]
 

Set supplied value to the signaling NaN.

void SAMRAI::tbox::IEEE::initializeArrayToSignalingNaN Array< float > &  data  )  [static]
 

Initialize an array of floats to signaling NaNs. Before using this array in any operation, the NaN value should be reset. Otherwise, an unrecoverable exception will result (as long as floating point exception handling is supported by the compiler).

void SAMRAI::tbox::IEEE::initializeArrayToSignalingNaN Array< double > &  data  )  [static]
 

Initialize an array of floats to signaling NaNs. Before using this array in any operation, the NaN value should be reset. Otherwise, an unrecoverable exception will result (as long as floating point exception handling is supported by the compiler).

void SAMRAI::tbox::IEEE::initializeArrayToINT_MAX Array< int > &  data  )  [static]
 

Initialize an array of ints to system INT_MAX.

void SAMRAI::tbox::IEEE::initializeArrayToINT_MIN Array< int > &  data  )  [static]
 

Initialize an array of ints to system INT_MIN.

void SAMRAI::tbox::IEEE::initializeArrayToFLT_MAX Array< float > &  data  )  [static]
 

Initialize an array of floats to system FLT_MAX.

void SAMRAI::tbox::IEEE::initializeArrayToFLT_MIN Array< float > &  data  )  [static]
 

Initialize an array of floats to system FLT_MIN.

void SAMRAI::tbox::IEEE::initializeArrayToDBL_MAX Array< double > &  data  )  [static]
 

Initialize an array of doubles to system DBL_MAX.

void SAMRAI::tbox::IEEE::initializeArrayToDBL_MIN Array< double > &  data  )  [static]
 

Initialize an array of doubles to system DBL_MIN.

void SAMRAI::tbox::IEEE::initializeArrayToSignalingNaN float *  data,
const int  n = 1
[static]
 

Initialize an array of floats to signaling NaNs. Before using this array in any operation, the NaN value should be reset. Otherwise, an unrecoverable exception will result (as long as floating point exception handling is supported by the compiler).

void SAMRAI::tbox::IEEE::initializeArrayToSignalingNaN double *  data,
const int  n = 1
[static]
 

Initialize an array of floats to signaling NaNs. Before using this array in any operation, the NaN value should be reset. Otherwise, an unrecoverable exception will result (as long as floating point exception handling is supported by the compiler).

void SAMRAI::tbox::IEEE::initializeArrayToINT_MAX int *  data,
const int  n = 1
[static]
 

Initialize an array of ints to system INT_MAX.

void SAMRAI::tbox::IEEE::initializeArrayToINT_MIN int *  data,
const int  n = 1
[static]
 

Initialize an array of ints to system INT_MIN.

void SAMRAI::tbox::IEEE::initializeArrayToFLT_MAX float *  data,
const int  n = 1
[static]
 

Initialize an array of floats to system FLT_MAX.

void SAMRAI::tbox::IEEE::initializeArrayToFLT_MIN float *  data,
const int  n = 1
[static]
 

Initialize an array of floats to system FLT_MIN.

void SAMRAI::tbox::IEEE::initializeArrayToDBL_MAX double *  data,
const int  n = 1
[static]
 

Initialize an array of doubles to system DBL_MAX.

void SAMRAI::tbox::IEEE::initializeArrayToDBL_MIN double *  data,
const int  n = 1
[static]
 

Initialize an array of doubles to system DBL_MIN.

bool SAMRAI::tbox::IEEE::isNaN const float &  f  )  [static]
 

Indicates whether the supplied value is NaN.

bool SAMRAI::tbox::IEEE::isNaN const double &  d  )  [static]
 

Indicates whether the supplied value is NaN.


The documentation for this struct was generated from the following files:
Generated on Fri Dec 2 11:33:16 2005 for SAMRAI by  doxygen 1.4.2