ARTS 2.5.11 (git: 725533f0)
nonstd.h
Go to the documentation of this file.
1#ifndef nonstd_h
2#define nonstd_h
3
5namespace nonstd {
13template <class T> constexpr T abs(T x) noexcept {return x < 0 ? - x : x;}
14
24constexpr int isdigit(int ch) noexcept {
25 return ch == '0' or ch == '1' or ch == '2' or ch == '3' or
26 ch == '4' or ch == '5' or ch == '6' or ch == '7' or
27 ch == '8' or ch == '9';
28}
29
39constexpr int isspace(int ch) noexcept {
40 return ch == ' ' or ch == '\n' or ch == '\r' or ch == '\t' or ch == '\f' or
41 ch == '\v';
42}
43
53constexpr bool isnan(double d) noexcept {return d not_eq d;}
54constexpr bool isnan(long double d) noexcept {return d not_eq d;}
55constexpr bool isnan(float d) noexcept {return d not_eq d;}
56} // namespace nonstd
57
58#endif
Definition nonstd.h:5
constexpr T abs(T x) noexcept
Definition nonstd.h:13
constexpr int isdigit(int ch) noexcept
Definition nonstd.h:24
constexpr bool isnan(double d) noexcept
Definition nonstd.h:53
constexpr int isspace(int ch) noexcept
Returns 1 if x is a standard space-character.
Definition nonstd.h:39
#define d