File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -189,3 +189,26 @@ constexpr decimal128_t operator-(decimal128_t rhs) noexcept;
189189----
190190
191191Returns negated `rhs` in all cases.
192+
193+ === Addition
194+
195+ [source,c++]
196+ ----
197+ // 3.2.8 binary arithmetic operators:
198+ // LHS and RHS can be any integer or decimal type
199+
200+ constexpr /* see 3.2.8 */ operator+(LHS lhs, decimal32_t rhs) noexcept;
201+ constexpr /* see 3.2.8 */ operator+(LHS lhs, decimal64_t rhs) noexcept;
202+ constexpr /* see 3.2.8 */ operator+(LHS lhs, decimal128_t rhs) noexcept;
203+ constexpr /* see 3.2.8 */ operator+(decimal32_t lhs, RHS rhs) noexcept;
204+ constexpr /* see 3.2.8 */ operator+(decimal64_t lhs, RHS rhs) noexcept;
205+ constexpr /* see 3.2.8 */ operator+(decimal128_t lhs, RHS rhs) noexcept;
206+ ----
207+
208+ Returns the result of `lhs + rhs` subject to:
209+
210+ . If either `lhs` or `rhs` are `NAN`, returns `QNAN`
211+ . If `lhs` and `rhs` are `INF` of opposite sign, returns `QNAN`
212+ . If either `lhs` or `rhs` are `INF`, returns `INF` of same sign
213+ . If `lhs + rhs` overflows, returns `INF`
214+ . If `lhs + rhs` underflows, returns `0`
You can’t perform that action at this time.
0 commit comments