Skip to content

Commit 2bb9ddd

Browse files
committed
Add comparison operators behavior
1 parent 94f374c commit 2bb9ddd

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

doc/modules/ROOT/pages/generic_decimal.adoc

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,3 +284,53 @@ Returns the result of `lhs / rhs` subject to:
284284
. If `rhs` is `INF` returns `0`
285285
. If `lhs / rhs` overflows, returns `INF`
286286
. If `lhs / rhs` underflows, returns `0`
287+
288+
== Comparison Operators
289+
290+
[source, c++]
291+
----
292+
// 3.2.9 comparison operators:
293+
// LHS and RHS can be any integer or decimal type
294+
295+
constexpr bool operator==(LHS lhs, decimal32_t rhs) noexcept;
296+
constexpr bool operator==(LHS lhs, decimal64_t rhs) noexcept;
297+
constexpr bool operator==(LHS lhs, decimal128_t rhs) noexcept;
298+
constexpr bool operator==(decimal32_t lhs, RHS rhs) noexcept;
299+
constexpr bool operator==(decimal64_t lhs, RHS rhs) noexcept;
300+
constexpr bool operator==(decimal128_t lhs, RHS rhs) noexcept;
301+
constexpr bool operator!=(LHS lhs, decimal32_t rhs) noexcept;
302+
constexpr bool operator!=(LHS lhs, decimal64_t rhs) noexcept;
303+
constexpr bool operator!=(LHS lhs, decimal128_t rhs) noexcept;
304+
constexpr bool operator!=(decimal32_t lhs, RHS rhs) noexcept;
305+
constexpr bool operator!=(decimal64_t lhs, RHS rhs) noexcept;
306+
constexpr bool operator!=(decimal128_t lhs, RHS rhs) noexcept;
307+
constexpr bool operator<(LHS lhs, decimal32_t rhs) noexcept;
308+
constexpr bool operator<(LHS lhs, decimal64_t rhs) noexcept;
309+
constexpr bool operator<(LHS lhs, decimal128_t rhs) noexcept;
310+
constexpr bool operator<(decimal32_t lhs, RHS rhs) noexcept;
311+
constexpr bool operator<(decimal64_t lhs, RHS rhs) noexcept;
312+
constexpr bool operator<(decimal128_t lhs, RHS rhs) noexcept;
313+
constexpr bool operator<=(LHS lhs, decimal32_t rhs) noexcept;
314+
constexpr bool operator<=(LHS lhs, decimal64_t rhs) noexcept;
315+
constexpr bool operator<=(LHS lhs, decimal128_t rhs) noexcept;
316+
constexpr bool operator<=(decimal32_t lhs, RHS rhs) noexcept;
317+
constexpr bool operator<=(decimal64_t lhs, RHS rhs) noexcept;
318+
constexpr bool operator<=(decimal128_t lhs, RHS rhs) noexcept;
319+
constexpr bool operator>(LHS lhs, decimal32_t rhs) noexcept;
320+
constexpr bool operator>(LHS lhs, decimal64_t rhs) noexcept;
321+
constexpr bool operator>(LHS lhs, decimal128_t rhs) noexcept;
322+
constexpr bool operator>(decimal32_t lhs, RHS rhs) noexcept;
323+
constexpr bool operator>(decimal64_t lhs, RHS rhs) noexcept;
324+
constexpr bool operator>(decimal128_t lhs, RHS rhs) noexcept;
325+
constexpr bool operator>=(LHS lhs, decimal32_t rhs) noexcept;
326+
constexpr bool operator>=(LHS lhs, decimal64_t rhs) noexcept;
327+
constexpr bool operator>=(LHS lhs, decimal128_t rhs) noexcept;
328+
constexpr bool operator>=(decimal32_t lhs, RHS rhs) noexcept;
329+
constexpr bool operator>=(decimal64_t lhs, RHS rhs) noexcept;
330+
constexpr bool operator>=(decimal128_t lhs, RHS rhs) noexcept;
331+
----
332+
333+
Returns the result of the comparison subject to:
334+
335+
. If `lhs` or `rhs` returns `false`
336+
.. This includes the case where both `lhs` and `rhs` are `NAN`

0 commit comments

Comments
 (0)