#include <source/toolbox/base/IEEE.h>
Static Public Member Functions | |
static void | setupFloatingPointExceptionHandlers () |
static float | getSignalingFloatNaN () |
static double | getSignalingNaN () |
static dcomplex | getSignalingComplexNaN () |
static void | setNaN (float &f) |
static void | setNaN (double &d) |
static void | setNaN (dcomplex &dc) |
static void | initializeArrayToSignalingNaN (Array< float > &array) |
static void | initializeArrayToSignalingNaN (Array< double > &array) |
static void | initializeArrayToSignalingNaN (Array< dcomplex > &array) |
static void | initializeArrayToSignalingNaN (float *array, int n=1) |
static void | initializeArrayToSignalingNaN (double *array, int n=1) |
static void | initializeArrayToSignalingNaN (dcomplex *array, int n=1) |
static bool | isNaN (const float &f) |
static bool | isNaN (const double &d) |
static bool | isNaN (const dcomplex &dc) |
IMPORTANT: To properly trap operations based on signaling NaN values, the routine IEEE::setupFloatingPointExceptionHandlers() must be called. This is normally done in the SAMRAIManager::startup() routine.
Note that all operations provided by this class (except for setting up exception handling) are implemented in
void SAMRAI::tbox::IEEE::setupFloatingPointExceptionHandlers | ( | ) | [static] |
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.
dcomplex SAMRAI::tbox::IEEE::getSignalingComplexNaN | ( | ) | [inline, static] |
Get the dcomplex value with real and imaginary parts set to the IEEE double signaling NaN on architectures that support it. Using this value in a numerical expression will cause a program abort.
void SAMRAI::tbox::IEEE::setNaN | ( | float & | f | ) | [inline, static] |
Set supplied float value to the signaling NaN.
void SAMRAI::tbox::IEEE::setNaN | ( | double & | d | ) | [inline, static] |
Set supplied double value to the signaling NaN.
void SAMRAI::tbox::IEEE::setNaN | ( | dcomplex & | dc | ) | [inline, static] |
Set real and imaginary parts of supplied dcomplex value to the double signaling NaN.
void SAMRAI::tbox::IEEE::initializeArrayToSignalingNaN | ( | Array< float > & | array | ) | [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 > & | array | ) | [static] |
Initialize an array of doubles 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).
Initialize an array of dcomplex 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 | ( | float * | array, | |
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 * | array, | |
int | n = 1 | |||
) | [static] |
Initialize an array of doubles 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 | ( | dcomplex * | array, | |
int | n = 1 | |||
) | [static] |
Initialize an array of dcomplex 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).
bool SAMRAI::tbox::IEEE::isNaN | ( | const float & | f | ) | [inline, static] |
Return true if the supplied float value is NaN; else, false.
bool SAMRAI::tbox::IEEE::isNaN | ( | const double & | d | ) | [inline, static] |
Return true if the supplied double value is NaN; else, false.
bool SAMRAI::tbox::IEEE::isNaN | ( | const dcomplex & | dc | ) | [inline, static] |
Return true if if either real and imaginary part of the supplied dcomplex value is NaN; else, false.