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