|
bool | is_nan (const double x) |
|
bool | is_finite (const double x) |
|
bool | is_finite (const std::complex< double > &x) |
|
bool | is_finite (const std::complex< float > &x) |
|
bool | is_finite (const std::complex< long double > &x) |
|
template<typename Number1 , typename Number2 > |
bool | values_are_equal (const Number1 &value_1, const Number2 &value_2) |
|
template<typename Number1 , typename Number2 > |
bool | values_are_not_equal (const Number1 &value_1, const Number2 &value_2) |
|
template<typename Number > |
bool | value_is_zero (const Number &value) |
|
template<typename Number1 , typename Number2 > |
bool | value_is_less_than (const Number1 &value_1, const Number2 &value_2) |
|
template<typename Number1 , typename Number2 > |
bool | value_is_less_than_or_equal_to (const Number1 &value_1, const Number2 &value_2) |
|
template<typename Number1 , typename Number2 > |
bool | value_is_greater_than (const Number1 &value_1, const Number2 &value_2) |
|
template<typename Number1 , typename Number2 > |
bool | value_is_greater_than_or_equal_to (const Number1 &value_1, const Number2 &value_2) |
|
template<class T > |
T | signaling_nan () |
|
Namespace for the declaration of universal constants. Since the availability in math.h
is not always guaranteed, we put them here. Since this file is included by base/config.h
, they are available to the whole library.
The constants defined here are a subset of the M_XXX
constants sometimes declared in the system include file math.h
, but without the prefix M_
.
In addition to that, we declare invalid_unsigned_int
to be the largest unsigned integer representable; this value is widely used in the library as a marker for an invalid index, an invalid size of an array, and similar purposes.
bool numbers::is_nan |
( |
const double |
x | ) |
|
|
inline |
Check whether a value is not a number.
This function uses either std::isnan
, isnan
, or _isnan
, whichever is available on the system and returns the result.
If none of the functions detecting NaN is available, this function returns false.
- Deprecated:
- This function has been deprecated in favor of the C++11 function
std::isnan
.
Definition at line 422 of file numbers.h.
bool numbers::is_finite |
( |
const double |
x | ) |
|
|
inline |
Return true
if the given value is a finite floating point number, i.e. is neither plus or minus infinity nor NaN (not a number).
Note that the argument type of this function is double
. In other words, if you give a very large number of type long double
, this function may return false
even if the number is finite with respect to type long double
.
Definition at line 428 of file numbers.h.
template<typename Number1 , typename Number2 >
bool numbers::values_are_equal |
( |
const Number1 & |
value_1, |
|
|
const Number2 & |
value_2 |
|
) |
| |
|
inline |
Return whether two numbers are equal to one another.
For intricate data types (e.g. some automatically differentiable numbers), this function returns the result of the comparison of scalar values stored by the input arguments.
- Note
- This function expects that
value_2
is castable to the type of value_1
.
Definition at line 786 of file numbers.h.
template<typename Number1 , typename Number2 >
bool numbers::values_are_not_equal |
( |
const Number1 & |
value_1, |
|
|
const Number2 & |
value_2 |
|
) |
| |
|
inline |
Return whether two numbers are not equal to one another.
For intricate data types (e.g. some automatically differentiable numbers), this function returns the result of the comparison of scalar values stored by the input arguments.
- Note
- This function expects that
value_2
is castable to the type of value_1
.
Definition at line 794 of file numbers.h.
template<typename Number >
bool numbers::value_is_zero |
( |
const Number & |
value | ) |
|
|
inline |
Return whether or not a value is equal to zero.
For intricate data types (e.g. some automatically differentiable numbers), this function returns the result of the comparison of scalar values stored by the input arguments.
Definition at line 802 of file numbers.h.
template<typename Number1 , typename Number2 >
bool numbers::value_is_less_than |
( |
const Number1 & |
value_1, |
|
|
const Number2 & |
value_2 |
|
) |
| |
|
inline |
Return whether value_1
is less than that of value_2
.
For intricate data types (e.g. some automatically differentiable numbers), this function returns the result of the comparison of scalar values stored by the input arguments.
- Note
- This function expects that
value_2
is castable to the type of value_1
.
Definition at line 810 of file numbers.h.
template<typename Number1 , typename Number2 >
bool numbers::value_is_less_than_or_equal_to |
( |
const Number1 & |
value_1, |
|
|
const Number2 & |
value_2 |
|
) |
| |
|
inline |
Return whether value_1
is less than or equal to that of value_2
.
For intricate data types (e.g. some automatically differentiable numbers), this function returns the result of the comparison of scalar values stored by the input arguments.
- Note
- This function expects that
value_2
is castable to the type of value_1
.
Definition at line 818 of file numbers.h.
template<typename Number1 , typename Number2 >
bool numbers::value_is_greater_than |
( |
const Number1 & |
value_1, |
|
|
const Number2 & |
value_2 |
|
) |
| |
Return whether value_1
is greater than that of value_2
.
For intricate data types (e.g. some automatically differentiable numbers), this function returns the result of the comparison of scalar values stored by the input arguments.
- Note
- This function expects that
value_2
is castable to the type of value_1
.
Definition at line 827 of file numbers.h.
template<typename Number1 , typename Number2 >
bool numbers::value_is_greater_than_or_equal_to |
( |
const Number1 & |
value_1, |
|
|
const Number2 & |
value_2 |
|
) |
| |
|
inline |
Return whether value_1
is greater than or equal to that of value_2
.
For intricate data types (e.g. some automatically differentiable numbers), this function returns the result of the comparison of scalar values stored by the input arguments.
- Note
- This function expects that
value_2
is castable to the type of value_1
.
Definition at line 835 of file numbers.h.