|
| mpreal | at (Precision p) const |
| |
| void | copy_to (mpfr_ptr destination) const |
| | Round into an initialized MPFR destination at its existing precision.
|
| |
| exact_rational const & | exact_value () const |
| | Borrow the exact rational; valid while this object retains its state.
|
| |
| bool | initialized () const noexcept |
| | Whether this object holds an exact or approximate numerical value.
|
| |
| bool | is_exact () const noexcept |
| | Whether the active payload is an exact rational.
|
| |
| | mpreal () |
| | Construct exact zero for ordinary generic accumulators.
|
| |
| | mpreal (decimal_literal value) |
| |
| | mpreal (decimal_literal value, Precision p) |
| |
| | mpreal (exact_rational const &value, Precision p) |
| |
| | mpreal (exact_rational value) |
| | Retain an exact rational without rounding.
|
| |
template<class F >
requires (std::same_as<F, float> || std::same_as<F, double> || std::same_as<F, long double>) |
| | mpreal (F value, Precision p) |
| | Import float, double or long double; precision must be finite.
|
| |
template<std::integral I>
requires (!std::same_as<I, bool>) |
| | mpreal (I value) |
| |
template<std::integral I>
requires (!std::same_as<I, bool>) |
| | mpreal (I value, Precision p) |
| |
| | mpreal (mpfr_srcptr value, Precision p) |
| | Copy a valid borrowed MPFR value, rounding at finite precision.
|
| |
| | mpreal (mpreal &&other) noexcept |
| | Transfer ownership, leaving the source unset.
|
| |
| | mpreal (mpreal const &)=default |
| |
| | mpreal (mpreal const &other, Precision p) |
| | Convert to finite precision, or retain an already-exact value in exact mode.
|
| |
| | mpreal (Precision p) |
| | Construct zero at finite precision, or exact zero.
|
| |
| | mpreal (std::string_view text, Precision p) |
| | Parse a complete decimal or integer fraction at the requested precision.
|
| |
| | mpreal (uninitialized_t) noexcept |
| | Construct an unset placeholder for overwrite storage.
|
| |
| mpfr_srcptr | native_handle () const |
| | Borrow an approximate MPFR value; exact and unset states require explicit materialization first.
|
| |
| | operator double () const |
| |
| | operator float () const |
| | Explicitly round to a native format, nearest with ties to even.
|
| |
| | operator long double () const |
| |
| mpreal & | operator*= (exact_rational const &rhs) |
| |
| mpreal & | operator*= (mpreal const &rhs) |
| |
| mpreal & | operator+= (exact_rational const &rhs) |
| |
| mpreal & | operator+= (mpreal const &rhs) |
| |
| mpreal & | operator-= (exact_rational const &rhs) |
| |
| mpreal & | operator-= (mpreal const &rhs) |
| |
| mpreal & | operator/= (exact_rational const &rhs) |
| |
| mpreal & | operator/= (mpreal const &rhs) |
| |
| mpreal & | operator= (mpreal other) noexcept |
| |
| Precision | precision () const |
| | Return exact state or the working precision stored by MPFR.
|
| |
| void | swap (mpreal &other) noexcept |
| |
| std::string | to_string (std::size_t digits=0) const |
| | Format exact rationals as numerator/denominator and approximations as decimal scientific notation.
|
| |
Owning exact rational or finite-precision MPFR real, with eager arithmetic.
Default construction is exact zero. Integers and exact literals need no working precision. Approximate arithmetic rounds to nearest, ties to even, and unequal finite precisions require explicit conversion. Assignment adopts the source state and precision. Native floating inputs require explicit finite precision.