Rhino C++ API  8.10
Static Public Member Functions | Static Public Attributes | List of all members
ON_DBL Class Reference

#include <opennurbs_defines.h>

Static Public Member Functions

static int Compare (const double *lhs, const double *rhs)
 Well ordered compare that handles nullpt and nans and sorts them to the end. ON_DBL::Compare(nullptr, nullptr) = 0; ON_DBL::Compare(not nullptr, nullptr) = -1; ON_DBL::Compare(nullptr, not nullptr) = +1; ON_DBL::Compare(not nullptr, not nullptr) = ON_DBL::CompareValue(*lhs,*rhs); More...
 
static int CompareValue (double lhs, double rhs)
 Well ordered compare that handles nans and sorts them to the end. ON_DBL::CompareValue(nan, nan) = 0; ON_DBL::CompareValue(non_nan, nan) = -1; ON_DBL::CompareValue(nan, non_nan) = +1; More...
 
static bool IsInfinity (double x)
 
static bool IsNan (double x)
 
static bool IsNegativeInfinity (double x)
 
static bool IsNotNan (double x)
 
static bool IsPositiveInfinity (double x)
 
static bool IsUnset (double x)
 
static bool IsValid (double x)
 All nans, +infinity, -infinity, x <= than ON_DBL::Unset and x >= ON_DBL::PositiveUnset are considered invalid because using them in typical calculations almost always returns useless results. More...
 
static int Sign (double x)
 

Static Public Attributes

static const double Nan
 ON_DBL::Nan is an IEEE quiet nan (not a number). More...
 
static const double NegativeInfinity
 ON_DBL::NegativeInfinity is IEEE -infinity. More...
 
static const double NegativeMax
 ON_DBL::NegativeMax = -1.7976931348623158e+308 More...
 
static const double NegativeMin
 ON_DBL::NegativeMax = -2.22507385850720200e-308 More...
 
static const double PositiveInfinity
 ON_DBL::PositiveInfinity is IEEE +infinity. More...
 
static const double PositiveMax
 ON_DBL::PositiveMax = +1.7976931348623158e+308 More...
 
static const double PositiveMin
 ON_DBL::PositiveMax = +2.22507385850720200e-308 More...
 
static const double PositiveUnset
 ON_DBL::PositiveUnset = +1.23432101234321e+308 More...
 
static const double Unset
 ON_DBL::Unset = -1.23432101234321e+308 More...
 

Member Function Documentation

◆ Compare()

static int ON_DBL::Compare ( const double *  lhs,
const double *  rhs 
)
static

Well ordered compare that handles nullpt and nans and sorts them to the end. ON_DBL::Compare(nullptr, nullptr) = 0; ON_DBL::Compare(not nullptr, nullptr) = -1; ON_DBL::Compare(nullptr, not nullptr) = +1; ON_DBL::Compare(not nullptr, not nullptr) = ON_DBL::CompareValue(*lhs,*rhs);

Parameters
lhs
rhs
Returns

◆ CompareValue()

static int ON_DBL::CompareValue ( double  lhs,
double  rhs 
)
static

Well ordered compare that handles nans and sorts them to the end. ON_DBL::CompareValue(nan, nan) = 0; ON_DBL::CompareValue(non_nan, nan) = -1; ON_DBL::CompareValue(nan, non_nan) = +1;

Parameters
lhs
rhs
Returns
-1 if lhs < rhs or IsNotNan(lhs) and IsNan(rhs). 0 if lhs == rhs or IsNan(lhs) && IsNan(rhs). +1 if lhs > rhs or IsNotNan(lhs) && IsNan(rhs).

◆ IsInfinity()

static bool ON_DBL::IsInfinity ( double  x)
static
Parameters
x
Returns
True if x is any type of infinity (positive, negative, projective).

◆ IsNan()

static bool ON_DBL::IsNan ( double  x)
static
Parameters
x
Returns
True if x is any type of nan (signaling or quiet).

◆ IsNegativeInfinity()

static bool ON_DBL::IsNegativeInfinity ( double  x)
static

◆ IsNotNan()

static bool ON_DBL::IsNotNan ( double  x)
static
Parameters
x
Returns
True if x is not a nan..

◆ IsPositiveInfinity()

static bool ON_DBL::IsPositiveInfinity ( double  x)
static

◆ IsUnset()

static bool ON_DBL::IsUnset ( double  x)
static

◆ IsValid()

static bool ON_DBL::IsValid ( double  x)
static

All nans, +infinity, -infinity, x <= than ON_DBL::Unset and x >= ON_DBL::PositiveUnset are considered invalid because using them in typical calculations almost always returns useless results.

Parameters
xvalue to test.
Returns
(ON_DBL::Unset < x && x < ON_DBL::PositiveUnset)

◆ Sign()

static int ON_DBL::Sign ( double  x)
static
Parameters
x
Returns
If x > 0, then +1 is returned. If x < 0, then -1 is returned. Otherwise 0 is returned.

Member Data Documentation

◆ Nan

const double ON_DBL::Nan
static

ON_DBL::Nan is an IEEE quiet nan (not a number).

◆ NegativeInfinity

const double ON_DBL::NegativeInfinity
static

ON_DBL::NegativeInfinity is IEEE -infinity.

◆ NegativeMax

const double ON_DBL::NegativeMax
static

ON_DBL::NegativeMax = -1.7976931348623158e+308

◆ NegativeMin

const double ON_DBL::NegativeMin
static

ON_DBL::NegativeMax = -2.22507385850720200e-308

◆ PositiveInfinity

const double ON_DBL::PositiveInfinity
static

ON_DBL::PositiveInfinity is IEEE +infinity.

◆ PositiveMax

const double ON_DBL::PositiveMax
static

ON_DBL::PositiveMax = +1.7976931348623158e+308

◆ PositiveMin

const double ON_DBL::PositiveMin
static

ON_DBL::PositiveMax = +2.22507385850720200e-308

◆ PositiveUnset

const double ON_DBL::PositiveUnset
static

ON_DBL::PositiveUnset = +1.23432101234321e+308

◆ Unset

const double ON_DBL::Unset
static

ON_DBL::Unset = -1.23432101234321e+308