ARTS 2.5.11 (git: 725533f0)
nonstd Namespace Reference

Functions

template<class T >
constexpr T abs (T x) noexcept
 
constexpr int isdigit (int ch) noexcept
 
constexpr int isspace (int ch) noexcept
 Returns 1 if x is a standard space-character.
 
constexpr bool isnan (double d) noexcept
 
constexpr bool isnan (long double d) noexcept
 
constexpr bool isnan (float d) noexcept
 

Detailed Description

For std functions that are changed somehow

Function Documentation

◆ abs()

template<class T >
constexpr T nonstd::abs ( x)
constexprnoexcept

abs(x) returns |x| using -x if x < 0 or x otherwise

Reason to re-implement: std::abs(x) is not officially constexpr

Parameters
[in]xAny real value type
Returns
|x|

Definition at line 13 of file nonstd.h.

◆ isdigit()

constexpr int nonstd::isdigit ( int  ch)
constexprnoexcept

Checks if the given character in 0123456789.

Reason to re-implement: std::isdigit(ch) is not officially constexpr

The int-interface is kept from the standard

Parameters
[in]chA character
Returns
int from a simple boolean.

Definition at line 24 of file nonstd.h.

Referenced by Quantum::Number::cast_qnrat(), Species::is_normal_isotopologue(), and Species::is_predefined_model().

◆ isnan() [1/3]

constexpr bool nonstd::isnan ( double  d)
constexprnoexcept

Checks if the given value is nan

Reason to re-implement: std::isnan(d) is not officially constexpr

Only the three basic interfaces are implemented

Parameters
[in]dA value
Returns
int from a simple boolean.

Definition at line 53 of file nonstd.h.

References d.

Referenced by Species::all_have_ratio(), Species::IsotopologueRatios::all_isotopes_have_a_value(), Species::mean_mass(), and Species::names_of_have_and_havenot_ratio().

◆ isnan() [2/3]

constexpr bool nonstd::isnan ( float  d)
constexprnoexcept

Definition at line 55 of file nonstd.h.

References d.

◆ isnan() [3/3]

constexpr bool nonstd::isnan ( long double  d)
constexprnoexcept

Definition at line 54 of file nonstd.h.

References d.

◆ isspace()

constexpr int nonstd::isspace ( int  ch)
constexprnoexcept

Returns 1 if x is a standard space-character.

Reason to re-implement: std::isspace(ch) is not officially constexpr

The int-interface is kept from the standard

Parameters
[in]xa character
Returns
1 if x is a space

Definition at line 39 of file nonstd.h.

Referenced by Quantum::Number::count_items(), enum_strarray(), Quantum::Number::items(), Quantum::Number::lstrip(), Quantum::Number::rstrip(), and Species::detail::trim().