ARTS 2.5.0 (git: 9ee3ac6c)
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 bool isnan(double d) noexcept {return d not_eq d;}
40constexpr bool isnan(long double d) noexcept {return d not_eq d;}
41constexpr bool isnan(float d) noexcept {return d not_eq d;}
42} // namespace nonstd
43
44#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:39
#define d