25#if !defined DUMUX_QUAD_HH && HAVE_QUAD
36#include <dune/common/typetraits.hh>
40using Quad = __float128;
49struct IsNumber<
Dumux::Quad> : std::true_type {};
57class numeric_limits<
Dumux::Quad>
60 static constexpr bool is_specialized =
true;
62 static constexpr Dumux::Quad min() noexcept
63 {
return FLT128_MIN; }
64 static constexpr Dumux::Quad max() noexcept
65 {
return FLT128_MAX; }
66 static constexpr Dumux::Quad lowest() noexcept
67 {
return -FLT128_MAX; }
70 static constexpr int digits = FLT128_MANT_DIG;
72 static constexpr int digits10 = FLT128_DIG;
73 static constexpr int max_digits10 = FLT128_MANT_DIG;
75 static constexpr bool is_signed =
true;
76 static constexpr bool is_integer =
false;
77 static constexpr bool is_exact =
false;
78 static constexpr int radix = 0;
79 static constexpr Dumux::Quad epsilon() noexcept
80 {
return FLT128_EPSILON; }
81 static constexpr Dumux::Quad round_error() noexcept
84 static constexpr int min_exponent = FLT128_MIN_EXP;
85 static constexpr int min_exponent10 = FLT128_MIN_10_EXP;
86 static constexpr int max_exponent = FLT128_MAX_EXP;
87 static constexpr int max_exponent10 = FLT128_MAX_10_EXP;
89 static constexpr bool has_infinity =
true;
90 static constexpr bool has_quiet_NaN =
true;
91 static constexpr bool has_signaling_NaN =
true;
92 static constexpr float_denorm_style has_denorm = denorm_present;
93 static constexpr bool has_denorm_loss =
false;
94 static constexpr Dumux::Quad infinity() noexcept
95 {
return __builtin_huge_valq(); };
96 static constexpr Dumux::Quad quiet_NaN() noexcept
97 {
return __builtin_nan(
""); }
98 static constexpr Dumux::Quad signaling_NaN() noexcept
99 {
return __builtin_nans(
""); }
100 static constexpr Dumux::Quad denorm_min() noexcept
101 {
return FLT128_DENORM_MIN; }
103 static constexpr bool is_iec559 =
true;
104 static constexpr bool is_bounded =
true;
105 static constexpr bool is_modulo =
false;
107 static constexpr bool traps = std::numeric_limits<double>::traps;
108 static constexpr bool tinyness_before = std::numeric_limits<double>::tinyness_before;
109 static constexpr float_round_style round_style = round_to_nearest;
119inline ostream& operator<<(ostream& os,
const Dumux::Quad &val)
121 return (os <<
double(val));
124inline istream& operator>>(istream& is, Dumux::Quad &val)
127 istream &ret = (is >> tmp);
132inline Dumux::Quad abs(Dumux::Quad val)
133{
return (val < 0)?-val:val; }
135inline Dumux::Quad floor(Dumux::Quad val)
136{
return floorq(val); }
138inline Dumux::Quad ceil(Dumux::Quad val)
139{
return ceilq(val); }
141inline Dumux::Quad max(Dumux::Quad a, Dumux::Quad b)
144inline Dumux::Quad min(Dumux::Quad a, Dumux::Quad b)
147inline Dumux::Quad sqrt(Dumux::Quad val)
148{
return sqrtq(val); }
150template <
class ExpType>
151inline Dumux::Quad pow(Dumux::Quad base, ExpType exp)
152{
return powq(base, exp); }
154inline Dumux::Quad exp(Dumux::Quad val)
157inline Dumux::Quad log(Dumux::Quad val)
160inline Dumux::Quad sin(Dumux::Quad val)
163inline Dumux::Quad cos(Dumux::Quad val)
166inline Dumux::Quad tan(Dumux::Quad val)
169inline Dumux::Quad atan(Dumux::Quad val)
170{
return atanq(val); }
172inline Dumux::Quad atan2(Dumux::Quad a, Dumux::Quad b)
173{
return atan2q(a, b); }
175inline bool signbit(Dumux::Quad val)
176{
return signbitq(val); }
178inline bool isfinite(Dumux::Quad val)
179{
return !isnanq(val) && !isinfq(val); }
181inline bool isnan(Dumux::Quad val)
182{
return isnanq(val); }
184inline bool isinf(Dumux::Quad val)
185{
return isinfq(val); }
Definition: common/pdesolver.hh:35