Skip to main content

MpfrInput

Trait MpfrInput 

Source
pub trait MpfrInput {
    // Required methods
    fn to_bigfloat(&self, bits: u64) -> BigFloat;
    fn to_bigfloat_digits(&self, digits: u32) -> BigFloat;
}
Expand description

Trait for types that can be converted into a BigFloat.

This is implemented for &str and f64, allowing the free arithmetic and mathematical functions to accept both numeric string literals and native floats as arguments.

Required Methods§

Source

fn to_bigfloat(&self, bits: u64) -> BigFloat

Converts the value to a BigFloat with the given bit‑precision.

Source

fn to_bigfloat_digits(&self, digits: u32) -> BigFloat

Converts the value to a BigFloat with a precision sufficient for digits decimal digits.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl MpfrInput for &str

Source§

fn to_bigfloat(&self, bits: u64) -> BigFloat

Source§

fn to_bigfloat_digits(&self, digits: u32) -> BigFloat

Source§

impl MpfrInput for f64

Source§

fn to_bigfloat(&self, bits: u64) -> BigFloat

Source§

fn to_bigfloat_digits(&self, digits: u32) -> BigFloat

Implementors§