Skip to content

Commit 7f442a1

Browse files
committed
Add unary arithmetic operator behavior
1 parent 593bfb4 commit 7f442a1

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

doc/modules/ROOT/pages/generic_decimal.adoc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,28 @@ In the event of binary arithmetic between two decimal types the result will be t
164164
== 3.2.10 Note
165165

166166
xref:design.adoc#non-finite-deviation[Non-finite values are supported]
167+
168+
== Operator Behaviors
169+
170+
=== Unary Plus
171+
172+
[source,c++]
173+
----
174+
// 3.2.7 unary arithmetic operators:
175+
constexpr decimal32_t operator+(decimal32_t rhs) noexcept;
176+
constexpr decimal64_t operator+(decimal64_t rhs) noexcept;
177+
constexpr decimal128_t operator+(decimal128_t rhs) noexcept;
178+
----
179+
180+
Returns `rhs` unmodified in all cases.
181+
182+
=== Unary Minus
183+
184+
[source,c++]
185+
----
186+
constexpr decimal32_t operator-(decimal32_t rhs) noexcept;
187+
constexpr decimal64_t operator-(decimal64_t rhs) noexcept;
188+
constexpr decimal128_t operator-(decimal128_t rhs) noexcept;
189+
----
190+
191+
Returns negated `rhs` in all cases.

0 commit comments

Comments
 (0)