@@ -108,11 +108,144 @@ explicit constexpr operator std::float64_t() const noexcept;
108108explicit constexpr operator std::bfloat16_t() const noexcept;
109109
110110explicit constexpr operator decimal32_t() const noexcept;
111+ explicit constexpr operator decimal_fast32_t() const noexcept;
111112explicit constexpr operator decimal64_t() const noexcept;
113+ explicit constexpr operator decimal_fast64_t() const noexcept;
114+ explicit constexpr operator decimal128_t() const noexcept;
112115
113116}; // class decimal_fast128_t
114117
115118} //namespace decimal
116119} //namespace boost
117120
118121----
122+
123+
124+ == Operator Behavior
125+
126+ === Construction to and from binary floating-point type
127+
128+ [source, c++]
129+ ----
130+ // 3.2.2.2 Conversion from floating-point type
131+ template <typename Float>
132+ explicit BOOST_DECIMAL_CXX20_CONSTEXPR decimal_fast128_t(Float val) noexcept;
133+
134+ // 3.2.6 Conversion to floating-point type
135+ explicit BOOST_DECIMAL_CXX20_CONSTEXPR operator float() const noexcept;
136+ explicit BOOST_DECIMAL_CXX20_CONSTEXPR operator double() const noexcept;
137+ explicit BOOST_DECIMAL_CXX20_CONSTEXPR operator long double() const noexcept;
138+
139+ // If C++23 and <stdfloat> are available
140+ explicit constexpr operator std::float16_t() const noexcept;
141+ explicit constexpr operator std::float32_t() const noexcept;
142+ explicit constexpr operator std::float64_t() const noexcept;
143+ explicit constexpr operator std::bfloat16_t() const noexcept;
144+ ----
145+
146+ See: xref:binary_floating_conversions.adoc[]
147+
148+ === Construction From Integral Type
149+
150+ [source,c++]
151+ ----
152+ // 3.2.2.3 Conversion from integral type
153+ template <typename Integer>
154+ explicit constexpr decimal_fast128_t(Integer val) noexcept;
155+ ----
156+
157+ Constructs a decimal value subject to the current rounding mode (if necessary).
158+
159+ === Construction From String
160+
161+ [source,c++]
162+ ----
163+ // Extension: Construction from (c)string
164+ explicit constexpr decimal_fast128_t(const char* str);
165+
166+ #ifndef BOOST_DECIMAL_HAS_STD_STRING_VIEW
167+ explicit inline decimal_fast128_t(const std::string& str);
168+ #else
169+ explicit constexpr decimal_fast128_t(std::string_view str);
170+ #endif
171+ ----
172+
173+ Constructs a decimal value that matches `str` subject to:
174+
175+ . If `str` is a `nullptr` or of length 0 either:
176+ .. `throw std::runtime_error`
177+ .. Constructs a `QNAN` in a no exception environment
178+ . If `str` is an invalid string either:
179+ .. `throw std::runtime_error`
180+ .. Constructs a `QNAN` in a no exception environment
181+ . On overflow constructs `INF`
182+ . On underflow constructs `0`
183+ . Rounds value represented by `str` according to current rounding mode
184+
185+ === Conversion to Integral Type
186+
187+ [source,c++]
188+ ----
189+ // 3.2.2.4 Conversion to integral type
190+
191+ explicit constexpr operator int() const noexcept;
192+ explicit constexpr operator unsigned() const noexcept;
193+ explicit constexpr operator long() const noexcept;
194+ explicit constexpr operator unsigned long() const noexcept;
195+ explicit constexpr operator long long() const noexcept;
196+ explicit constexpr operator unsigned long long() const noexcept;
197+ ----
198+
199+ Constructs an integer representation of the decimal value subject to:
200+
201+ . If the decimal value is `INF` returns `std::numeric_limits<IntegerType>::max()`
202+ . If the decimal value is `NAN` returns `std::numeric_limits<IntegerType>::max()`
203+ . If the decimal value exceeds the range of the `IntegerType` returns `std::numeric_limits<IntegerType>::max()`
204+
205+ === Increment and Decrement Operators
206+
207+ [source,c++]
208+ ----
209+ // 3.2.2.5 increment and decrement operators:
210+ constexpr decimal_fast128_t& operator++();
211+ constexpr decimal_fast128_t operator++(int);
212+ constexpr decimal_fast128_t& operator--();
213+ constexpr decimal_fast128_t operator--(int);
214+ ----
215+
216+ Increments/Decrements the decimal value subject to:
217+
218+ . If the decimal value is `NAN` returns `QNAN`
219+ . If the decimal value is `INF` returns `INF`
220+
221+ === Compound Operators
222+
223+ [source, c++]
224+ ----
225+ // 3.2.2.6 compound assignment:
226+ constexpr decimal_fast128_t& operator+=(RHS rhs);
227+ constexpr decimal_fast128_t& operator-=(RHS rhs);
228+ constexpr decimal_fast128_t& operator*=(RHS rhs);
229+ constexpr decimal_fast128_t& operator/=(RHS rhs);
230+ ----
231+
232+ Matches the behavior of xref:generic_decimal.adoc#operator_behavior[addition, subtraction, multiplication, and division].
233+
234+ === Conversion to Other Decimal Types
235+
236+ [source,c++]
237+ ----
238+ explicit constexpr operator decimal32_t() const noexcept;
239+ explicit constexpr operator decimal_fast32_t() const noexcept;
240+ explicit constexpr operator decimal64_t() const noexcept;
241+ explicit constexpr operator decimal_fast64_t() const noexcept;
242+ explicit constexpr operator decimal128_t() const noexcept;
243+ ----
244+
245+ Conversion to `decimal128_t` is lossless in all cases.
246+
247+ Conversion to any other decimal type is subject to:
248+
249+ . Current rounding mode if the number of digits exceeds the precision of the target type.
250+ . Overflow constructs `INF`.
251+ . Underflow constructs `0`.
0 commit comments