Skip to content

Commit 19dfe2e

Browse files
committed
Add multiplication behavior
1 parent 9be7d4e commit 19dfe2e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

doc/modules/ROOT/pages/generic_decimal.adoc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,26 @@ Returns the result of `lhs - rhs` subject to:
235235
. If either `lhs` or `rhs` are `INF`, returns `INF` of same sign
236236
. If `lhs - rhs` overflows, returns `INF`
237237
. If `lhs - rhs` underflows, returns `0`
238+
239+
=== Multiplication
240+
241+
[source,c++]
242+
----
243+
// 3.2.8 binary arithmetic operators:
244+
// LHS and RHS can be any integer or decimal type
245+
246+
constexpr /* see 3.2.8 */ operator*(LHS lhs, decimal32_t rhs) noexcept;
247+
constexpr /* see 3.2.8 */ operator*(LHS lhs, decimal64_t rhs) noexcept;
248+
constexpr /* see 3.2.8 */ operator*(LHS lhs, decimal128_t rhs) noexcept;
249+
constexpr /* see 3.2.8 */ operator*(decimal32_t lhs, RHS rhs) noexcept;
250+
constexpr /* see 3.2.8 */ operator*(decimal64_t lhs, RHS rhs) noexcept;
251+
constexpr /* see 3.2.8 */ operator*(decimal128_t lhs, RHS rhs) noexcept;
252+
----
253+
254+
Returns the result of `lhs * rhs` subject to:
255+
256+
. If either `lhs` or `rhs` are `NAN`, returns `QNAN`
257+
. If either `lhs` or `rhs` are `INF` and the other is `0`, returns `QNAN`
258+
. If either `lhs` or `rhs` are `INF`, returns `INF` of same sign
259+
. If `lhs * rhs` overflows, returns `INF`
260+
. If `lhs * rhs` underflows, returns `0`

0 commit comments

Comments
 (0)