STIR  6.2.0
Macros
ieeefp.h File Reference

Definition of work-around macros STIR_isnan and STIR_finite for a few non-portable IEEE floating point functions. More...

#include "stir/common.h"
#include <cmath>

Go to the source code of this file.

Macros

#define STIR_isnan(x)   (x) != (x)
 
#define STIR_finite(x)   true
 
#define STIR_finite   finite
 
#define STIR_isnan   isnan
 

Detailed Description

Definition of work-around macros STIR_isnan and STIR_finite for a few non-portable IEEE floating point functions.

Warning
The setting of these macros is tricky and only tested on a few systems. Hopefully, somebody else can find a better way. For example, http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2004/n1568.htm
Author
Kris Thielemans

Macro Definition Documentation

◆ STIR_isnan [1/2]

#define STIR_isnan (   x)    (x) != (x)

A (hopefully) portable way to call isnan. Current implementation does not always find isnan and then reverts to (x)!=(x), which according to IEEE math should work as well.

◆ STIR_finite [1/2]

#define STIR_finite (   x)    true

A (hopefully) portable way to call finite. But problems can occur on your system. Current implementation does not always find finite and then reverts to true.

◆ STIR_finite [2/2]

#define STIR_finite   finite

A (hopefully) portable way to call finite. But problems can occur on your system. Current implementation does not always find finite and then reverts to true.

◆ STIR_isnan [2/2]

#define STIR_isnan   isnan

A (hopefully) portable way to call isnan. Current implementation does not always find isnan and then reverts to (x)!=(x), which according to IEEE math should work as well.