Skip to content

Commit d454dcb

Browse files
committed
Add behavior of conversion to integral type
1 parent 9162ea1 commit d454dcb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

doc/modules/ROOT/pages/decimal32_t.adoc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,23 @@ Constructs a decimal value that matches `str` subject to:
164164
. On overflow constructs `INF`
165165
. On underflow constructs `0`
166166
. Rounds value represented by `str` according to current rounding mode
167+
168+
=== Conversion to integral type
169+
170+
[source,c++]
171+
----
172+
// 3.2.2.4 Conversion to integral type
173+
174+
explicit constexpr operator int() const noexcept;
175+
explicit constexpr operator unsigned() const noexcept;
176+
explicit constexpr operator long() const noexcept;
177+
explicit constexpr operator unsigned long() const noexcept;
178+
explicit constexpr operator long long() const noexcept;
179+
explicit constexpr operator unsigned long long() const noexcept;
180+
----
181+
182+
Constructs an integer representation of the decimal value subject to:
183+
184+
. If the decimal value is `INF` returns `std::numeric_limits<IntegerType>::max()`
185+
. If the decimal value is `NAN` returns `std::numeric_limits<IntegerType>::max()`
186+
. If the decimal value exceeds the range of the `IntegerType` returns `std::numeric_limits<IntegerType>::max()`

0 commit comments

Comments
 (0)