CppUnit project page | FAQ

FloatingPoint.h
Go to the documentation of this file.
1#ifndef CPPUNIT_PORTABILITY_FLOATINGPOINT_H_INCLUDED
2#define CPPUNIT_PORTABILITY_FLOATINGPOINT_H_INCLUDED
3
4#include <cppunit/Portability.h>
5#include <cmath>
6
7 CPPUNIT_NS_BEGIN
8
9 inline bool floatingPointIsUnordered( double x )
10{
11 return std::isnan(x);
12}
13
14
17 inline int floatingPointIsFinite( double x )
18{
19 return std::isfinite(x);
20}
21
22 CPPUNIT_NS_END
23
24#endif // CPPUNIT_PORTABILITY_FLOATINGPOINT_H_INCLUDED
floatingPointIsFinite
int floatingPointIsFinite(double x)
Tests if a floating-point is finite.
Definition FloatingPoint.h:17
floatingPointIsUnordered
CPPUNIT_NS_BEGIN bool floatingPointIsUnordered(double x)
Definition FloatingPoint.h:9
Portability.h
CPPUNIT_NS_END
#define CPPUNIT_NS_END
Definition Portability.h:106
CPPUNIT_NS_BEGIN
#define CPPUNIT_NS_BEGIN
Definition Portability.h:105

| Send comments to: CppUnit Developers