devela::all

Struct Float

Source
#[repr(transparent)]
pub struct Float<T>(pub T);
Expand description

Provides comprehensive floating-point operations for T, most of them const.

See also the ExtFloat and ExtFloatConst traits.

§Methods

TODO

§Features

It depends on having any _float_f[32|64] features enabled.

The wrapper leverages std or libm if enabled, otherwise implements fallbacks. It also favors std style for method’s names, but changes a few like minimum for min_nan and maximum for max_nan, for consistency.

If both the libm and std features are enabled the libm functions will be used, since it contains more functions, namely:

Tuple Fields§

§0: T

Implementations§

Source§

impl Float<f32>

§Mathematical constants

Source

pub const ONE: Float<f32>

The multiplicative identity 1.

Source

pub const ZERO: Float<f32>

The additive identity 0.

Source

pub const NEG_ONE: Float<f32>

The negative of the multiplicative identity -1.

Source

pub const NEG_ZERO: Float<f32>

The negative of the additive identity -0.

Source

pub const NAN: Float<f32>

Not a Number (NaN).

Source

pub const INFINITY: Float<f32>

Infinity (∞).

Source

pub const NEG_INFINITY: Float<f32>

Negative infinity (-∞).

Source

pub const EPSILON: Float<f32>

Machine epsilon value.

This is the smallest difference detectable between 1.0 and the next representable number in the floating-point format.

Source

pub const LOW_MARGIN: Float<f32>

Allows for minimal deviation; use for high precision needs..

Source

pub const MEDIUM_MARGIN: Float<f32>

Accommodates moderate deviation; balances precision and flexibility.

Source

pub const HIGH_MARGIN: Float<f32>

Permits generous deviation; suitable for less precise scenarios.

Source

pub const RADIX: u32 = 2u32

The radix or base of the internal representation.

Source

pub const DIGITS: u32 = 6u32

Approximate number of significant digits in base 10.

Source

pub const MANTISSA_DIGITS: u32 = 24u32

Number of significant digits in base 2.

Source

pub const MIN: Float<f32>

Smallest finite value.

Source

pub const MIN_POSITIVE: Float<f32>

Smallest positive normal value.

Source

pub const MAX: Float<f32>

Largest finite value.

Source

pub const MIN_EXP: i32 = -125i32

One greater than the minimum possible normal power of 2 exponent.

Source

pub const MAX_EXP: i32 = 128i32

Maximum possible power of 2 exponent.

Source

pub const MIN_10_EXP: i32 = -37i32

Minimum x for which 10x is normal.

Source

pub const MAX_10_EXP: i32 = 38i32

Maximum x for which 10x is normal.

Source

pub const PI: Float<f32>

$ π = \frac{1}{2} τ = 180º $ (A000796) ≈ 3.14159265…

The ratio of the circumference to the diameter, a half-turn.

Source

pub const FRAC_PI_2: Float<f32>

$ π/2 = τ/4 = 90º $ (A019669) ≈ 1.57079632…

Source

pub const FRAC_PI_3: Float<f32>

$ π/3 = τ/6 = 60º $ (A019670) ≈ 1.04719755…

Source

pub const FRAC_PI_4: Float<f32>

$ π/4 = τ/8 = 45º $ (A003881) ≈ 0.78539816…

Source

pub const FRAC_PI_6: Float<f32>

$ π/6 = τ/12 = 30º $ (A019673) ≈ 0.52359877…

Source

pub const FRAC_PI_8: Float<f32>

$ π/8 = τ/16 = 22.5º $ (A019675) ≈ 0.39269908…

Source

pub const SQRT_PI: Float<f32>

$ \sqrt{π} = \sqrt{\frac{1}{2} τ} $ (A002161) ≈ 1.77245385…

Source

pub const FRAC_1_PI: Float<f32>

$ 1/π = 2/τ $ (A049541) ≈ 0.31830988…

Source

pub const FRAC_1_SQRT_PI: Float<f32>

$ 1/\sqrt{π} = 1/\sqrt{τ/2} $ (A087197) ≈ 0.56418958…

Source

pub const FRAC_1_SQRT_2PI: Float<f32>

$ 1/\sqrt{2π} = 1/\sqrt{τ} $ (A231863) ≈ 0.39894228…

Source

pub const FRAC_2_PI: Float<f32>

$ 2/π $ (A060294) ≈ 0.63661977…

Buffon’s constant.

Source

pub const FRAC_2_SQRT_PI: Float<f32>

$ 2/\sqrt{π} $ (A190732) ≈ 1.12837916…

Source

pub const TAU: Float<f32>

$ τ = 2π = 360º $ (A019692) ≈ 6.28318530…

The ratio of the circumference to the radius, a full-turn.

Source

pub const FRAC_TAU_2: Float<f32> = Self::PI

$ τ/2 = π = 180º $ (A000796) ≈ 3.14159265…

Source

pub const FRAC_TAU_3: Float<f32>

$ τ/3 = 2π/3 = 120º $ (A019693) ≈ 2.09439510…

Source

pub const FRAC_TAU_4: Float<f32> = Self::FRAC_PI_2

$ τ/4 = π/2 = 90º $ (A019693) ≈ 1.57079632…

Source

pub const FRAC_TAU_5: Float<f32>

$ τ/5 = 2π/5 = 72º $ (A019694) ≈ 1.25663706…

Source

pub const FRAC_TAU_6: Float<f32> = Self::FRAC_PI_3

$ τ/6 = π/3 = 60º $ (A019670) ≈ 1.04719755…

Source

pub const FRAC_TAU_8: Float<f32> = Self::FRAC_PI_4

$ τ/8 = π/4 = 45º $ (A003881) ≈ 0.78539816…

Source

pub const FRAC_TAU_9: Float<f32>

$ τ/9 = 2π/9 = 40º $ (A019696) ≈ 0.69813170…

Source

pub const FRAC_TAU_12: Float<f32> = Self::FRAC_PI_6

$ τ/12 = π/6 = 30º $ (A019673) ≈ 0.52359877…

Source

pub const FRAC_TAU_16: Float<f32> = Self::FRAC_PI_8

$ τ/16 = π/8 = 22.5º $ (A019675) ≈ 0.39269908…

Source

pub const FRAC_TAU_24: Float<f32>

$ τ/24 = π/12 = 15º $ (A019679) ≈ 0.26179938…

Source

pub const FRAC_TAU_72: Float<f32>

$ τ/72 = π/36 = 5º $ ≈ 0.08726646…

Source

pub const FRAC_360_TAU: Float<f32>

$ 360/τ = 180/π $ (A072097) ≈ 57.2957795…

Source

pub const SQRT_TAU: Float<f32>

$ \sqrt{τ} = \sqrt{2π} $ (A019727) ≈ 2.50662827…

Source

pub const FRAC_1_TAU: Float<f32>

$ 1/τ = 1/2π $ (A086201) ≈ 0.15915494…

Source

pub const FRAC_1_SQRT_TAU: Float<f32>

$ 1/\sqrt{τ} = 1/\sqrt{2π} $ (A231863) ≈ 0.39894228…

Source

pub const FRAC_2_TAU: Float<f32> = Self::FRAC_1_PI

$ 2/τ = 1/π $ (A049541) ≈ 0.31830988…

Source

pub const FRAC_2_SQRT_TAU: Float<f32>

$ 2/\sqrt{τ} = \sqrt{2/π} $ (A076668) ≈ 0.79788456…

Source

pub const ARC_DEGREE: Float<f32>

$ τ/360 = π/180 = 1º $ arc degree (A019685, wikipedia) ≈ 0.01745329…

Source

pub const ARC_MINUTE: Float<f32>

$ τ/(360*60) = 1’ $ arc minute (wikipedia) ≈ 0.00029088…

Source

pub const ARC_SECOND: Float<f32>

$ τ/(360 * 60 * 60) = 1’’ $ arc second (wikipedia) ≈ 0.00000484…

Source

pub const PHI: Float<f32>

$ φ = (1+\sqrt{5})/2 $ (A001622) ≈ 1.61803398…

The golden ratio.

Continued fraction: $ [1;1,1,1,…] $

Source

pub const SQ_PHI: Float<f32>

$ φ^2 = φ+1 = (3+\sqrt{5})/2 $ (A104457) ≈ 2.61803398…

Source

pub const FRAC_1_PHI: Float<f32>

$ 1/φ = φ-1 $ (A094214) ≈ 0.61803398…

The reciprocal of φ.

Source

pub const NEG_FRAC_1_PHI: Float<f32>

$ -1/φ = 1-φ $ ≈ -0.61803398…

The negative reciprocal of φ and its conjugate in $ x^2-x-1 $.

Source

pub const SQRT_PHI: Float<f32>

$ \sqrt{φ} $ (A139339) ≈ 1.27201964…

Source

pub const FRAC_1_SQRT_PHI: Float<f32>

$ 1/\sqrt{φ} = \sqrt{φ/φ^2} = \sqrt{φ^2-2} $ (A197762) ≈ 0.78615137…

Source

pub const TRIBONACCI: Float<f32>

(A058265) ≈ 1.83928675…

The tribonacci constant.

Source

pub const SQRT_2: Float<f32>

$ \sqrt{2} $ (A002193, wikipedia) ≈ 1.41421356…

Source

pub const FRAC_1_SQRT_2: Float<f32>

$ 1/\sqrt{2} = \sqrt{1/2} $ (A010503, wikipedia) ≈ 0.70710678…

Source

pub const SQRT_3: Float<f32>

$ \sqrt{3} $ (A002194, wikipedia) ≈ 1.73205080…

Source

pub const FRAC_1_SQRT_3: Float<f32>

$ 1/\sqrt{3} = \sqrt{1/3} $ (A020760, ≈ 0.57735026…

Source

pub const SQRT_5: Float<f32>

$ \sqrt{5} $ (A002163, wikipedia) ≈ 2.23606797…

Source

pub const SQRT_6: Float<f32>

$ \sqrt{6} $ (A010464) ≈ 2.44948974…

Source

pub const SQRT_7: Float<f32>

$ \sqrt{7} $ (A010465) ≈ 2.64575131…

Source

pub const SQRT_8: Float<f32>

$ \sqrt{8} $ (A010466) ≈ 2.82842712…

Source

pub const SQRT_10: Float<f32>

$ \sqrt{10} $ (A010467) ≈ 3.16227766…

Source

pub const SQRT_11: Float<f32>

$ \sqrt{11} $ (A010468) ≈ 3.31662479…

Source

pub const SQRT_12: Float<f32>

$ \sqrt{12} $ (A010469) ≈ 3.46410161…

Source

pub const CBRT_2: Float<f32>

$ \sqrt{2} $ (A002193, wikipedia) ≈ 1.41421356…

Source

pub const CBRT_3: Float<f32>

$ \sqrt[\small 3]{3} $ (A002581) ≈ 1.44224957…

Source

pub const FRAC_1_CBRT_3: Float<f32>

$ 1/\sqrt[\small 3]{3} = (\normalsize\frac{1}{3})^{\small\frac{1}{3}} $ (A072365) ≈ 0.69336127…

Source

pub const E: Float<f32>

$ e $ (A001113) ≈ 2.71828182…

The Euler number or Napier’s constant.

Continuous fraction: $ [2;1,2,1,1,4,1,1,6,1,…,1,2n,1,…] $

Source

pub const EGAMMA: Float<f32>

$ γ $ (A001620) ≈ 0.57721566…

Gamma, or the Euler-Mascheroni constant.

Source

pub const LOG2_E: Float<f32>

$ \log_2{e} $ (A007525) ≈ 1.44269504…

Source

pub const LOG2_10: Float<f32>

log2(10) (A020862) ≈ 3.32192809…

Source

pub const LOG10_E: Float<f32>

log10(e) (A002285) ≈ 0.43429448…

Source

pub const LOG10_2: Float<f32>

log10(2) (A007524) ≈ 0.30102999…

Source

pub const LN_2: Float<f32>

ln(2) (A002162) ≈ 0.69314718…

Source

pub const LN_10: Float<f32>

ln(10) (A002392) ≈ 2.30258509…

Source§

impl Float<f64>

§Mathematical constants

Source

pub const ONE: Float<f64>

The multiplicative identity 1.

Source

pub const ZERO: Float<f64>

The additive identity 0.

Source

pub const NEG_ONE: Float<f64>

The negative of the multiplicative identity -1.

Source

pub const NEG_ZERO: Float<f64>

The negative of the additive identity -0.

Source

pub const NAN: Float<f64>

Not a Number (NaN).

Source

pub const INFINITY: Float<f64>

Infinity (∞).

Source

pub const NEG_INFINITY: Float<f64>

Negative infinity (-∞).

Source

pub const EPSILON: Float<f64>

Machine epsilon value.

This is the smallest difference detectable between 1.0 and the next representable number in the floating-point format.

Source

pub const LOW_MARGIN: Float<f64>

Allows for minimal deviation; use for high precision needs..

Source

pub const MEDIUM_MARGIN: Float<f64>

Accommodates moderate deviation; balances precision and flexibility.

Source

pub const HIGH_MARGIN: Float<f64>

Permits generous deviation; suitable for less precise scenarios.

Source

pub const RADIX: u32 = 2u32

The radix or base of the internal representation.

Source

pub const DIGITS: u32 = 15u32

Approximate number of significant digits in base 10.

Source

pub const MANTISSA_DIGITS: u32 = 53u32

Number of significant digits in base 2.

Source

pub const MIN: Float<f64>

Smallest finite value.

Source

pub const MIN_POSITIVE: Float<f64>

Smallest positive normal value.

Source

pub const MAX: Float<f64>

Largest finite value.

Source

pub const MIN_EXP: i32 = -1_021i32

One greater than the minimum possible normal power of 2 exponent.

Source

pub const MAX_EXP: i32 = 1_024i32

Maximum possible power of 2 exponent.

Source

pub const MIN_10_EXP: i32 = -307i32

Minimum x for which 10x is normal.

Source

pub const MAX_10_EXP: i32 = 308i32

Maximum x for which 10x is normal.

Source

pub const PI: Float<f64>

$ π = \frac{1}{2} τ = 180º $ (A000796) ≈ 3.14159265…

The ratio of the circumference to the diameter, a half-turn.

Source

pub const FRAC_PI_2: Float<f64>

$ π/2 = τ/4 = 90º $ (A019669) ≈ 1.57079632…

Source

pub const FRAC_PI_3: Float<f64>

$ π/3 = τ/6 = 60º $ (A019670) ≈ 1.04719755…

Source

pub const FRAC_PI_4: Float<f64>

$ π/4 = τ/8 = 45º $ (A003881) ≈ 0.78539816…

Source

pub const FRAC_PI_6: Float<f64>

$ π/6 = τ/12 = 30º $ (A019673) ≈ 0.52359877…

Source

pub const FRAC_PI_8: Float<f64>

$ π/8 = τ/16 = 22.5º $ (A019675) ≈ 0.39269908…

Source

pub const SQRT_PI: Float<f64>

$ \sqrt{π} = \sqrt{\frac{1}{2} τ} $ (A002161) ≈ 1.77245385…

Source

pub const FRAC_1_PI: Float<f64>

$ 1/π = 2/τ $ (A049541) ≈ 0.31830988…

Source

pub const FRAC_1_SQRT_PI: Float<f64>

$ 1/\sqrt{π} = 1/\sqrt{τ/2} $ (A087197) ≈ 0.56418958…

Source

pub const FRAC_1_SQRT_2PI: Float<f64>

$ 1/\sqrt{2π} = 1/\sqrt{τ} $ (A231863) ≈ 0.39894228…

Source

pub const FRAC_2_PI: Float<f64>

$ 2/π $ (A060294) ≈ 0.63661977…

Buffon’s constant.

Source

pub const FRAC_2_SQRT_PI: Float<f64>

$ 2/\sqrt{π} $ (A190732) ≈ 1.12837916…

Source

pub const TAU: Float<f64>

$ τ = 2π = 360º $ (A019692) ≈ 6.28318530…

The ratio of the circumference to the radius, a full-turn.

Source

pub const FRAC_TAU_2: Float<f64> = Self::PI

$ τ/2 = π = 180º $ (A000796) ≈ 3.14159265…

Source

pub const FRAC_TAU_3: Float<f64>

$ τ/3 = 2π/3 = 120º $ (A019693) ≈ 2.09439510…

Source

pub const FRAC_TAU_4: Float<f64> = Self::FRAC_PI_2

$ τ/4 = π/2 = 90º $ (A019693) ≈ 1.57079632…

Source

pub const FRAC_TAU_5: Float<f64>

$ τ/5 = 2π/5 = 72º $ (A019694) ≈ 1.25663706…

Source

pub const FRAC_TAU_6: Float<f64> = Self::FRAC_PI_3

$ τ/6 = π/3 = 60º $ (A019670) ≈ 1.04719755…

Source

pub const FRAC_TAU_8: Float<f64> = Self::FRAC_PI_4

$ τ/8 = π/4 = 45º $ (A003881) ≈ 0.78539816…

Source

pub const FRAC_TAU_9: Float<f64>

$ τ/9 = 2π/9 = 40º $ (A019696) ≈ 0.69813170…

Source

pub const FRAC_TAU_12: Float<f64> = Self::FRAC_PI_6

$ τ/12 = π/6 = 30º $ (A019673) ≈ 0.52359877…

Source

pub const FRAC_TAU_16: Float<f64> = Self::FRAC_PI_8

$ τ/16 = π/8 = 22.5º $ (A019675) ≈ 0.39269908…

Source

pub const FRAC_TAU_24: Float<f64>

$ τ/24 = π/12 = 15º $ (A019679) ≈ 0.26179938…

Source

pub const FRAC_TAU_72: Float<f64>

$ τ/72 = π/36 = 5º $ ≈ 0.08726646…

Source

pub const FRAC_360_TAU: Float<f64>

$ 360/τ = 180/π $ (A072097) ≈ 57.2957795…

Source

pub const SQRT_TAU: Float<f64>

$ \sqrt{τ} = \sqrt{2π} $ (A019727) ≈ 2.50662827…

Source

pub const FRAC_1_TAU: Float<f64>

$ 1/τ = 1/2π $ (A086201) ≈ 0.15915494…

Source

pub const FRAC_1_SQRT_TAU: Float<f64>

$ 1/\sqrt{τ} = 1/\sqrt{2π} $ (A231863) ≈ 0.39894228…

Source

pub const FRAC_2_TAU: Float<f64> = Self::FRAC_1_PI

$ 2/τ = 1/π $ (A049541) ≈ 0.31830988…

Source

pub const FRAC_2_SQRT_TAU: Float<f64>

$ 2/\sqrt{τ} = \sqrt{2/π} $ (A076668) ≈ 0.79788456…

Source

pub const ARC_DEGREE: Float<f64>

$ τ/360 = π/180 = 1º $ arc degree (A019685, wikipedia) ≈ 0.01745329…

Source

pub const ARC_MINUTE: Float<f64>

$ τ/(360*60) = 1’ $ arc minute (wikipedia) ≈ 0.00029088…

Source

pub const ARC_SECOND: Float<f64>

$ τ/(360 * 60 * 60) = 1’’ $ arc second (wikipedia) ≈ 0.00000484…

Source

pub const PHI: Float<f64>

$ φ = (1+\sqrt{5})/2 $ (A001622) ≈ 1.61803398…

The golden ratio.

Continued fraction: $ [1;1,1,1,…] $

Source

pub const SQ_PHI: Float<f64>

$ φ^2 = φ+1 = (3+\sqrt{5})/2 $ (A104457) ≈ 2.61803398…

Source

pub const FRAC_1_PHI: Float<f64>

$ 1/φ = φ-1 $ (A094214) ≈ 0.61803398…

The reciprocal of φ.

Source

pub const NEG_FRAC_1_PHI: Float<f64>

$ -1/φ = 1-φ $ ≈ -0.61803398…

The negative reciprocal of φ and its conjugate in $ x^2-x-1 $.

Source

pub const SQRT_PHI: Float<f64>

$ \sqrt{φ} $ (A139339) ≈ 1.27201964…

Source

pub const FRAC_1_SQRT_PHI: Float<f64>

$ 1/\sqrt{φ} = \sqrt{φ/φ^2} = \sqrt{φ^2-2} $ (A197762) ≈ 0.78615137…

Source

pub const TRIBONACCI: Float<f64>

(A058265) ≈ 1.83928675…

The tribonacci constant.

Source

pub const SQRT_2: Float<f64>

$ \sqrt{2} $ (A002193, wikipedia) ≈ 1.41421356…

Source

pub const FRAC_1_SQRT_2: Float<f64>

$ 1/\sqrt{2} = \sqrt{1/2} $ (A010503, wikipedia) ≈ 0.70710678…

Source

pub const SQRT_3: Float<f64>

$ \sqrt{3} $ (A002194, wikipedia) ≈ 1.73205080…

Source

pub const FRAC_1_SQRT_3: Float<f64>

$ 1/\sqrt{3} = \sqrt{1/3} $ (A020760, ≈ 0.57735026…

Source

pub const SQRT_5: Float<f64>

$ \sqrt{5} $ (A002163, wikipedia) ≈ 2.23606797…

Source

pub const SQRT_6: Float<f64>

$ \sqrt{6} $ (A010464) ≈ 2.44948974…

Source

pub const SQRT_7: Float<f64>

$ \sqrt{7} $ (A010465) ≈ 2.64575131…

Source

pub const SQRT_8: Float<f64>

$ \sqrt{8} $ (A010466) ≈ 2.82842712…

Source

pub const SQRT_10: Float<f64>

$ \sqrt{10} $ (A010467) ≈ 3.16227766…

Source

pub const SQRT_11: Float<f64>

$ \sqrt{11} $ (A010468) ≈ 3.31662479…

Source

pub const SQRT_12: Float<f64>

$ \sqrt{12} $ (A010469) ≈ 3.46410161…

Source

pub const CBRT_2: Float<f64>

$ \sqrt{2} $ (A002193, wikipedia) ≈ 1.41421356…

Source

pub const CBRT_3: Float<f64>

$ \sqrt[\small 3]{3} $ (A002581) ≈ 1.44224957…

Source

pub const FRAC_1_CBRT_3: Float<f64>

$ 1/\sqrt[\small 3]{3} = (\normalsize\frac{1}{3})^{\small\frac{1}{3}} $ (A072365) ≈ 0.69336127…

Source

pub const E: Float<f64>

$ e $ (A001113) ≈ 2.71828182…

The Euler number or Napier’s constant.

Continuous fraction: $ [2;1,2,1,1,4,1,1,6,1,…,1,2n,1,…] $

Source

pub const EGAMMA: Float<f64>

$ γ $ (A001620) ≈ 0.57721566…

Gamma, or the Euler-Mascheroni constant.

Source

pub const LOG2_E: Float<f64>

$ \log_2{e} $ (A007525) ≈ 1.44269504…

Source

pub const LOG2_10: Float<f64>

log2(10) (A020862) ≈ 3.32192809…

Source

pub const LOG10_E: Float<f64>

log10(e) (A002285) ≈ 0.43429448…

Source

pub const LOG10_2: Float<f64>

log10(2) (A007524) ≈ 0.30102999…

Source

pub const LN_2: Float<f64>

ln(2) (A002162) ≈ 0.69314718…

Source

pub const LN_10: Float<f64>

ln(10) (A002392) ≈ 2.30258509…

Source§

impl Float<f16>

§Mathematical constants

Source

pub const ONE: Float<f16>

The multiplicative identity 1.

Source

pub const ZERO: Float<f16>

The additive identity 0.

Source

pub const NEG_ONE: Float<f16>

The negative of the multiplicative identity -1.

Source

pub const NEG_ZERO: Float<f16>

The negative of the additive identity -0.

Source

pub const NAN: Float<f16>

Not a Number (NaN).

Source

pub const INFINITY: Float<f16>

Infinity (∞).

Source

pub const NEG_INFINITY: Float<f16>

Negative infinity (-∞).

Source

pub const EPSILON: Float<f16>

Machine epsilon value.

This is the smallest difference detectable between 1.0 and the next representable number in the floating-point format.

Source

pub const LOW_MARGIN: Float<f16>

Allows for minimal deviation; use for high precision needs..

Source

pub const MEDIUM_MARGIN: Float<f16>

Accommodates moderate deviation; balances precision and flexibility.

Source

pub const HIGH_MARGIN: Float<f16>

Permits generous deviation; suitable for less precise scenarios.

Source

pub const RADIX: u32 = 2u32

The radix or base of the internal representation.

Source

pub const DIGITS: u32 = 3u32

Approximate number of significant digits in base 10.

Source

pub const MANTISSA_DIGITS: u32 = 11u32

Number of significant digits in base 2.

Source

pub const MIN: Float<f16>

Smallest finite value.

Source

pub const MIN_POSITIVE: Float<f16>

Smallest positive normal value.

Source

pub const MAX: Float<f16>

Largest finite value.

Source

pub const MIN_EXP: i32 = -13i32

One greater than the minimum possible normal power of 2 exponent.

Source

pub const MAX_EXP: i32 = 16i32

Maximum possible power of 2 exponent.

Source

pub const MIN_10_EXP: i32 = -4i32

Minimum x for which 10x is normal.

Source

pub const MAX_10_EXP: i32 = 4i32

Maximum x for which 10x is normal.

Source

pub const PI: Float<f16>

$ π = \frac{1}{2} τ = 180º $ (A000796) ≈ 3.14159265…

The ratio of the circumference to the diameter, a half-turn.

Source

pub const FRAC_PI_2: Float<f16>

$ π/2 = τ/4 = 90º $ (A019669) ≈ 1.57079632…

Source

pub const FRAC_PI_3: Float<f16>

$ π/3 = τ/6 = 60º $ (A019670) ≈ 1.04719755…

Source

pub const FRAC_PI_4: Float<f16>

$ π/4 = τ/8 = 45º $ (A003881) ≈ 0.78539816…

Source

pub const FRAC_PI_6: Float<f16>

$ π/6 = τ/12 = 30º $ (A019673) ≈ 0.52359877…

Source

pub const FRAC_PI_8: Float<f16>

$ π/8 = τ/16 = 22.5º $ (A019675) ≈ 0.39269908…

Source

pub const SQRT_PI: Float<f16>

$ \sqrt{π} = \sqrt{\frac{1}{2} τ} $ (A002161) ≈ 1.77245385…

Source

pub const FRAC_1_PI: Float<f16>

$ 1/π = 2/τ $ (A049541) ≈ 0.31830988…

Source

pub const FRAC_1_SQRT_PI: Float<f16>

$ 1/\sqrt{π} = 1/\sqrt{τ/2} $ (A087197) ≈ 0.56418958…

Source

pub const FRAC_1_SQRT_2PI: Float<f16>

$ 1/\sqrt{2π} = 1/\sqrt{τ} $ (A231863) ≈ 0.39894228…

Source

pub const FRAC_2_PI: Float<f16>

$ 2/π $ (A060294) ≈ 0.63661977…

Buffon’s constant.

Source

pub const FRAC_2_SQRT_PI: Float<f16>

$ 2/\sqrt{π} $ (A190732) ≈ 1.12837916…

Source

pub const TAU: Float<f16>

$ τ = 2π = 360º $ (A019692) ≈ 6.28318530…

The ratio of the circumference to the radius, a full-turn.

Source

pub const FRAC_TAU_2: Float<f16> = Self::PI

$ τ/2 = π = 180º $ (A000796) ≈ 3.14159265…

Source

pub const FRAC_TAU_3: Float<f16>

$ τ/3 = 2π/3 = 120º $ (A019693) ≈ 2.09439510…

Source

pub const FRAC_TAU_4: Float<f16> = Self::FRAC_PI_2

$ τ/4 = π/2 = 90º $ (A019693) ≈ 1.57079632…

Source

pub const FRAC_TAU_5: Float<f16>

$ τ/5 = 2π/5 = 72º $ (A019694) ≈ 1.25663706…

Source

pub const FRAC_TAU_6: Float<f16> = Self::FRAC_PI_3

$ τ/6 = π/3 = 60º $ (A019670) ≈ 1.04719755…

Source

pub const FRAC_TAU_8: Float<f16> = Self::FRAC_PI_4

$ τ/8 = π/4 = 45º $ (A003881) ≈ 0.78539816…

Source

pub const FRAC_TAU_9: Float<f16>

$ τ/9 = 2π/9 = 40º $ (A019696) ≈ 0.69813170…

Source

pub const FRAC_TAU_12: Float<f16> = Self::FRAC_PI_6

$ τ/12 = π/6 = 30º $ (A019673) ≈ 0.52359877…

Source

pub const FRAC_TAU_16: Float<f16> = Self::FRAC_PI_8

$ τ/16 = π/8 = 22.5º $ (A019675) ≈ 0.39269908…

Source

pub const FRAC_TAU_24: Float<f16>

$ τ/24 = π/12 = 15º $ (A019679) ≈ 0.26179938…

Source

pub const FRAC_TAU_72: Float<f16>

$ τ/72 = π/36 = 5º $ ≈ 0.08726646…

Source

pub const FRAC_360_TAU: Float<f16>

$ 360/τ = 180/π $ (A072097) ≈ 57.2957795…

Source

pub const SQRT_TAU: Float<f16>

$ \sqrt{τ} = \sqrt{2π} $ (A019727) ≈ 2.50662827…

Source

pub const FRAC_1_TAU: Float<f16>

$ 1/τ = 1/2π $ (A086201) ≈ 0.15915494…

Source

pub const FRAC_1_SQRT_TAU: Float<f16>

$ 1/\sqrt{τ} = 1/\sqrt{2π} $ (A231863) ≈ 0.39894228…

Source

pub const FRAC_2_TAU: Float<f16> = Self::FRAC_1_PI

$ 2/τ = 1/π $ (A049541) ≈ 0.31830988…

Source

pub const FRAC_2_SQRT_TAU: Float<f16>

$ 2/\sqrt{τ} = \sqrt{2/π} $ (A076668) ≈ 0.79788456…

Source

pub const ARC_DEGREE: Float<f16>

$ τ/360 = π/180 = 1º $ arc degree (A019685, wikipedia) ≈ 0.01745329…

Source

pub const ARC_MINUTE: Float<f16>

$ τ/(360*60) = 1’ $ arc minute (wikipedia) ≈ 0.00029088…

Source

pub const ARC_SECOND: Float<f16>

$ τ/(360 * 60 * 60) = 1’’ $ arc second (wikipedia) ≈ 0.00000484…

Source

pub const PHI: Float<f16>

$ φ = (1+\sqrt{5})/2 $ (A001622) ≈ 1.61803398…

The golden ratio.

Continued fraction: $ [1;1,1,1,…] $

Source

pub const SQ_PHI: Float<f16>

$ φ^2 = φ+1 = (3+\sqrt{5})/2 $ (A104457) ≈ 2.61803398…

Source

pub const FRAC_1_PHI: Float<f16>

$ 1/φ = φ-1 $ (A094214) ≈ 0.61803398…

The reciprocal of φ.

Source

pub const NEG_FRAC_1_PHI: Float<f16>

$ -1/φ = 1-φ $ ≈ -0.61803398…

The negative reciprocal of φ and its conjugate in $ x^2-x-1 $.

Source

pub const SQRT_PHI: Float<f16>

$ \sqrt{φ} $ (A139339) ≈ 1.27201964…

Source

pub const FRAC_1_SQRT_PHI: Float<f16>

$ 1/\sqrt{φ} = \sqrt{φ/φ^2} = \sqrt{φ^2-2} $ (A197762) ≈ 0.78615137…

Source

pub const TRIBONACCI: Float<f16>

(A058265) ≈ 1.83928675…

The tribonacci constant.

Source

pub const SQRT_2: Float<f16>

$ \sqrt{2} $ (A002193, wikipedia) ≈ 1.41421356…

Source

pub const FRAC_1_SQRT_2: Float<f16>

$ 1/\sqrt{2} = \sqrt{1/2} $ (A010503, wikipedia) ≈ 0.70710678…

Source

pub const SQRT_3: Float<f16>

$ \sqrt{3} $ (A002194, wikipedia) ≈ 1.73205080…

Source

pub const FRAC_1_SQRT_3: Float<f16>

$ 1/\sqrt{3} = \sqrt{1/3} $ (A020760, ≈ 0.57735026…

Source

pub const SQRT_5: Float<f16>

$ \sqrt{5} $ (A002163, wikipedia) ≈ 2.23606797…

Source

pub const SQRT_6: Float<f16>

$ \sqrt{6} $ (A010464) ≈ 2.44948974…

Source

pub const SQRT_7: Float<f16>

$ \sqrt{7} $ (A010465) ≈ 2.64575131…

Source

pub const SQRT_8: Float<f16>

$ \sqrt{8} $ (A010466) ≈ 2.82842712…

Source

pub const SQRT_10: Float<f16>

$ \sqrt{10} $ (A010467) ≈ 3.16227766…

Source

pub const SQRT_11: Float<f16>

$ \sqrt{11} $ (A010468) ≈ 3.31662479…

Source

pub const SQRT_12: Float<f16>

$ \sqrt{12} $ (A010469) ≈ 3.46410161…

Source

pub const CBRT_2: Float<f16>

$ \sqrt{2} $ (A002193, wikipedia) ≈ 1.41421356…

Source

pub const CBRT_3: Float<f16>

$ \sqrt[\small 3]{3} $ (A002581) ≈ 1.44224957…

Source

pub const FRAC_1_CBRT_3: Float<f16>

$ 1/\sqrt[\small 3]{3} = (\normalsize\frac{1}{3})^{\small\frac{1}{3}} $ (A072365) ≈ 0.69336127…

Source

pub const E: Float<f16>

$ e $ (A001113) ≈ 2.71828182…

The Euler number or Napier’s constant.

Continuous fraction: $ [2;1,2,1,1,4,1,1,6,1,…,1,2n,1,…] $

Source

pub const EGAMMA: Float<f16>

$ γ $ (A001620) ≈ 0.57721566…

Gamma, or the Euler-Mascheroni constant.

Source

pub const LOG2_E: Float<f16>

$ \log_2{e} $ (A007525) ≈ 1.44269504…

Source

pub const LOG2_10: Float<f16>

log2(10) (A020862) ≈ 3.32192809…

Source

pub const LOG10_E: Float<f16>

log10(e) (A002285) ≈ 0.43429448…

Source

pub const LOG10_2: Float<f16>

log10(2) (A007524) ≈ 0.30102999…

Source

pub const LN_2: Float<f16>

ln(2) (A002162) ≈ 0.69314718…

Source

pub const LN_10: Float<f16>

ln(10) (A002392) ≈ 2.30258509…

Source§

impl Float<f128>

§Mathematical constants

Source

pub const ONE: Float<f128>

The multiplicative identity 1.

Source

pub const ZERO: Float<f128>

The additive identity 0.

Source

pub const NEG_ONE: Float<f128>

The negative of the multiplicative identity -1.

Source

pub const NEG_ZERO: Float<f128>

The negative of the additive identity -0.

Source

pub const NAN: Float<f128>

Not a Number (NaN).

Source

pub const INFINITY: Float<f128>

Infinity (∞).

Source

pub const NEG_INFINITY: Float<f128>

Negative infinity (-∞).

Source

pub const EPSILON: Float<f128>

Machine epsilon value.

This is the smallest difference detectable between 1.0 and the next representable number in the floating-point format.

Source

pub const LOW_MARGIN: Float<f128>

Allows for minimal deviation; use for high precision needs..

Source

pub const MEDIUM_MARGIN: Float<f128>

Accommodates moderate deviation; balances precision and flexibility.

Source

pub const HIGH_MARGIN: Float<f128>

Permits generous deviation; suitable for less precise scenarios.

Source

pub const RADIX: u32 = 2u32

The radix or base of the internal representation.

Source

pub const DIGITS: u32 = 33u32

Approximate number of significant digits in base 10.

Source

pub const MANTISSA_DIGITS: u32 = 113u32

Number of significant digits in base 2.

Source

pub const MIN: Float<f128>

Smallest finite value.

Source

pub const MIN_POSITIVE: Float<f128>

Smallest positive normal value.

Source

pub const MAX: Float<f128>

Largest finite value.

Source

pub const MIN_EXP: i32 = -16_381i32

One greater than the minimum possible normal power of 2 exponent.

Source

pub const MAX_EXP: i32 = 16_384i32

Maximum possible power of 2 exponent.

Source

pub const MIN_10_EXP: i32 = -4_931i32

Minimum x for which 10x is normal.

Source

pub const MAX_10_EXP: i32 = 4_932i32

Maximum x for which 10x is normal.

Source

pub const PI: Float<f128>

$ π = \frac{1}{2} τ = 180º $ (A000796) ≈ 3.14159265…

The ratio of the circumference to the diameter, a half-turn.

Source

pub const FRAC_PI_2: Float<f128>

$ π/2 = τ/4 = 90º $ (A019669) ≈ 1.57079632…

Source

pub const FRAC_PI_3: Float<f128>

$ π/3 = τ/6 = 60º $ (A019670) ≈ 1.04719755…

Source

pub const FRAC_PI_4: Float<f128>

$ π/4 = τ/8 = 45º $ (A003881) ≈ 0.78539816…

Source

pub const FRAC_PI_6: Float<f128>

$ π/6 = τ/12 = 30º $ (A019673) ≈ 0.52359877…

Source

pub const FRAC_PI_8: Float<f128>

$ π/8 = τ/16 = 22.5º $ (A019675) ≈ 0.39269908…

Source

pub const SQRT_PI: Float<f128>

$ \sqrt{π} = \sqrt{\frac{1}{2} τ} $ (A002161) ≈ 1.77245385…

Source

pub const FRAC_1_PI: Float<f128>

$ 1/π = 2/τ $ (A049541) ≈ 0.31830988…

Source

pub const FRAC_1_SQRT_PI: Float<f128>

$ 1/\sqrt{π} = 1/\sqrt{τ/2} $ (A087197) ≈ 0.56418958…

Source

pub const FRAC_1_SQRT_2PI: Float<f128>

$ 1/\sqrt{2π} = 1/\sqrt{τ} $ (A231863) ≈ 0.39894228…

Source

pub const FRAC_2_PI: Float<f128>

$ 2/π $ (A060294) ≈ 0.63661977…

Buffon’s constant.

Source

pub const FRAC_2_SQRT_PI: Float<f128>

$ 2/\sqrt{π} $ (A190732) ≈ 1.12837916…

Source

pub const TAU: Float<f128>

$ τ = 2π = 360º $ (A019692) ≈ 6.28318530…

The ratio of the circumference to the radius, a full-turn.

Source

pub const FRAC_TAU_2: Float<f128> = Self::PI

$ τ/2 = π = 180º $ (A000796) ≈ 3.14159265…

Source

pub const FRAC_TAU_3: Float<f128>

$ τ/3 = 2π/3 = 120º $ (A019693) ≈ 2.09439510…

Source

pub const FRAC_TAU_4: Float<f128> = Self::FRAC_PI_2

$ τ/4 = π/2 = 90º $ (A019693) ≈ 1.57079632…

Source

pub const FRAC_TAU_5: Float<f128>

$ τ/5 = 2π/5 = 72º $ (A019694) ≈ 1.25663706…

Source

pub const FRAC_TAU_6: Float<f128> = Self::FRAC_PI_3

$ τ/6 = π/3 = 60º $ (A019670) ≈ 1.04719755…

Source

pub const FRAC_TAU_8: Float<f128> = Self::FRAC_PI_4

$ τ/8 = π/4 = 45º $ (A003881) ≈ 0.78539816…

Source

pub const FRAC_TAU_9: Float<f128>

$ τ/9 = 2π/9 = 40º $ (A019696) ≈ 0.69813170…

Source

pub const FRAC_TAU_12: Float<f128> = Self::FRAC_PI_6

$ τ/12 = π/6 = 30º $ (A019673) ≈ 0.52359877…

Source

pub const FRAC_TAU_16: Float<f128> = Self::FRAC_PI_8

$ τ/16 = π/8 = 22.5º $ (A019675) ≈ 0.39269908…

Source

pub const FRAC_TAU_24: Float<f128>

$ τ/24 = π/12 = 15º $ (A019679) ≈ 0.26179938…

Source

pub const FRAC_TAU_72: Float<f128>

$ τ/72 = π/36 = 5º $ ≈ 0.08726646…

Source

pub const FRAC_360_TAU: Float<f128>

$ 360/τ = 180/π $ (A072097) ≈ 57.2957795…

Source

pub const SQRT_TAU: Float<f128>

$ \sqrt{τ} = \sqrt{2π} $ (A019727) ≈ 2.50662827…

Source

pub const FRAC_1_TAU: Float<f128>

$ 1/τ = 1/2π $ (A086201) ≈ 0.15915494…

Source

pub const FRAC_1_SQRT_TAU: Float<f128>

$ 1/\sqrt{τ} = 1/\sqrt{2π} $ (A231863) ≈ 0.39894228…

Source

pub const FRAC_2_TAU: Float<f128> = Self::FRAC_1_PI

$ 2/τ = 1/π $ (A049541) ≈ 0.31830988…

Source

pub const FRAC_2_SQRT_TAU: Float<f128>

$ 2/\sqrt{τ} = \sqrt{2/π} $ (A076668) ≈ 0.79788456…

Source

pub const ARC_DEGREE: Float<f128>

$ τ/360 = π/180 = 1º $ arc degree (A019685, wikipedia) ≈ 0.01745329…

Source

pub const ARC_MINUTE: Float<f128>

$ τ/(360*60) = 1’ $ arc minute (wikipedia) ≈ 0.00029088…

Source

pub const ARC_SECOND: Float<f128>

$ τ/(360 * 60 * 60) = 1’’ $ arc second (wikipedia) ≈ 0.00000484…

Source

pub const PHI: Float<f128>

$ φ = (1+\sqrt{5})/2 $ (A001622) ≈ 1.61803398…

The golden ratio.

Continued fraction: $ [1;1,1,1,…] $

Source

pub const SQ_PHI: Float<f128>

$ φ^2 = φ+1 = (3+\sqrt{5})/2 $ (A104457) ≈ 2.61803398…

Source

pub const FRAC_1_PHI: Float<f128>

$ 1/φ = φ-1 $ (A094214) ≈ 0.61803398…

The reciprocal of φ.

Source

pub const NEG_FRAC_1_PHI: Float<f128>

$ -1/φ = 1-φ $ ≈ -0.61803398…

The negative reciprocal of φ and its conjugate in $ x^2-x-1 $.

Source

pub const SQRT_PHI: Float<f128>

$ \sqrt{φ} $ (A139339) ≈ 1.27201964…

Source

pub const FRAC_1_SQRT_PHI: Float<f128>

$ 1/\sqrt{φ} = \sqrt{φ/φ^2} = \sqrt{φ^2-2} $ (A197762) ≈ 0.78615137…

Source

pub const TRIBONACCI: Float<f128>

(A058265) ≈ 1.83928675…

The tribonacci constant.

Source

pub const SQRT_2: Float<f128>

$ \sqrt{2} $ (A002193, wikipedia) ≈ 1.41421356…

Source

pub const FRAC_1_SQRT_2: Float<f128>

$ 1/\sqrt{2} = \sqrt{1/2} $ (A010503, wikipedia) ≈ 0.70710678…

Source

pub const SQRT_3: Float<f128>

$ \sqrt{3} $ (A002194, wikipedia) ≈ 1.73205080…

Source

pub const FRAC_1_SQRT_3: Float<f128>

$ 1/\sqrt{3} = \sqrt{1/3} $ (A020760, ≈ 0.57735026…

Source

pub const SQRT_5: Float<f128>

$ \sqrt{5} $ (A002163, wikipedia) ≈ 2.23606797…

Source

pub const SQRT_6: Float<f128>

$ \sqrt{6} $ (A010464) ≈ 2.44948974…

Source

pub const SQRT_7: Float<f128>

$ \sqrt{7} $ (A010465) ≈ 2.64575131…

Source

pub const SQRT_8: Float<f128>

$ \sqrt{8} $ (A010466) ≈ 2.82842712…

Source

pub const SQRT_10: Float<f128>

$ \sqrt{10} $ (A010467) ≈ 3.16227766…

Source

pub const SQRT_11: Float<f128>

$ \sqrt{11} $ (A010468) ≈ 3.31662479…

Source

pub const SQRT_12: Float<f128>

$ \sqrt{12} $ (A010469) ≈ 3.46410161…

Source

pub const CBRT_2: Float<f128>

$ \sqrt{2} $ (A002193, wikipedia) ≈ 1.41421356…

Source

pub const CBRT_3: Float<f128>

$ \sqrt[\small 3]{3} $ (A002581) ≈ 1.44224957…

Source

pub const FRAC_1_CBRT_3: Float<f128>

$ 1/\sqrt[\small 3]{3} = (\normalsize\frac{1}{3})^{\small\frac{1}{3}} $ (A072365) ≈ 0.69336127…

Source

pub const E: Float<f128>

$ e $ (A001113) ≈ 2.71828182…

The Euler number or Napier’s constant.

Continuous fraction: $ [2;1,2,1,1,4,1,1,6,1,…,1,2n,1,…] $

Source

pub const EGAMMA: Float<f128>

$ γ $ (A001620) ≈ 0.57721566…

Gamma, or the Euler-Mascheroni constant.

Source

pub const LOG2_E: Float<f128>

$ \log_2{e} $ (A007525) ≈ 1.44269504…

Source

pub const LOG2_10: Float<f128>

log2(10) (A020862) ≈ 3.32192809…

Source

pub const LOG10_E: Float<f128>

log10(e) (A002285) ≈ 0.43429448…

Source

pub const LOG10_2: Float<f128>

log10(2) (A007524) ≈ 0.30102999…

Source

pub const LN_2: Float<f128>

ln(2) (A002162) ≈ 0.69314718…

Source

pub const LN_10: Float<f128>

ln(10) (A002392) ≈ 2.30258509…

Source§

impl Float<f32>

§This implementation block leverages the libm feature.

Source

pub fn floor(self) -> Float<f32>

The largest integer less than or equal to x. $$ \lfloor x \rfloor = \max { n \in \mathbb{Z} ,|, n \leq x } $$

Source

pub fn ceil(self) -> Float<f32>

The smallest integer greater than or equal to x. $$ \lceil x \rceil = \min { n \in \mathbb{Z} ,|, n \geq x } $$

Source

pub fn round_ties_away(self) -> Float<f32>

The nearest integer to itself, rounding ties away from 0.0.

Source

pub fn trunc(self) -> Float<f32>

The integral part.

Source

pub fn copysign(self, sign: f32) -> Float<f32>

A number composed of its magnitude and the sign of other.

Source

pub fn mul_add(self, mul: f32, add: f32) -> Float<f32>

Fused multiply-add. Computes (self * mul) + add with only one rounding error.

Source

pub fn powf(self, p: f32) -> Float<f32>

Raises itself to the p floating point power.

Source

pub fn sqrt(self) -> Float<f32>

Square root.

Source

pub fn exp(self) -> Float<f32>

$e^x$ (the exponential function).

Source

pub fn exp2(self) -> Float<f32>

$2^x$.

Source

pub fn exp_m1(self) -> Float<f32>

$e^x -1$, more accurately for small values of x.

Source

pub fn ln(self) -> Float<f32>

The natural logarithm.

Source

pub fn ln_1p(self) -> Float<f32>

The natural logarithm plus 1, more accurately.

Source

pub fn log2(self) -> Float<f32>

The base 2 logarithm.

Source

pub fn log10(self) -> Float<f32>

The base 10 logarithm.

Source

pub fn cbrt(self) -> Float<f32>

The cubic root.

Source

pub fn hypot(self, other: f32) -> Float<f32>

The hypothenuse (the euclidean distance).

Source

pub fn sin(self) -> Float<f32>

The sine.

Source

pub fn cos(self) -> Float<f32>

The cosine.

Source

pub fn tan(self) -> Float<f32>

The tangent.

Source

pub fn asin(self) -> Float<f32>

The arc sine.

Source

pub fn acos(self) -> Float<f32>

The arc cosine.

Source

pub fn atan(self) -> Float<f32>

The arc tangent.

Source

pub fn atan2(self, other: f32) -> Float<f32>

The arc tangent of two variables.

Source

pub fn sinh(self) -> Float<f32>

The hyperbolic sine.

Source

pub fn cosh(self) -> Float<f32>

The hyperbolic cosine.

Source

pub fn tanh(self) -> Float<f32>

The hyperbolic tangent.

Source

pub fn asinh(self) -> Float<f32>

The inverse hyperbolic sine.

Source

pub fn acosh(self) -> Float<f32>

The inverse hyperbolic cosine.

Source

pub fn atanh(self) -> Float<f32>

The inverse hyperbolic tangent.

Source

pub fn max(self, other: f32) -> Float<f32>

The minimum of two numbers, ignoring NaN.

Source

pub fn min(self, other: f32) -> Float<f32>

The minimum of two numbers, ignoring NaN.

Source

pub fn exp10(self) -> Float<f32>

10^x.

Source

pub fn gamma(self) -> Float<f32>

The gamma function. Generalizes the factorial function to complex numbers.

Source

pub fn lgamma(self) -> Float<f32>

The natural logarithm of the absolute value of the gamma function.

Source

pub fn erf(self) -> Float<f32>

The error function.

Source

pub fn erfc(self) -> Float<f32>

The complementary error function (1 - erf).

Source

pub fn j0(self) -> Float<f32>

The bessel function of the first kind, of order 0.

Source

pub fn j1(self) -> Float<f32>

The bessel function of the first kind, of order 1.

Source

pub fn y0(self) -> Float<f32>

The bessel function of the second kind, of order 0.

Source

pub fn y1(self) -> Float<f32>

The bessel function of the second kind, of order 1.

Source§

impl Float<f64>

§This implementation block leverages the libm feature.

Source

pub fn floor(self) -> Float<f64>

The largest integer less than or equal to x. $$ \lfloor x \rfloor = \max { n \in \mathbb{Z} ,|, n \leq x } $$

Source

pub fn ceil(self) -> Float<f64>

The smallest integer greater than or equal to x. $$ \lceil x \rceil = \min { n \in \mathbb{Z} ,|, n \geq x } $$

Source

pub fn round_ties_away(self) -> Float<f64>

The nearest integer to itself, rounding ties away from 0.0.

Source

pub fn trunc(self) -> Float<f64>

The integral part.

Source

pub fn copysign(self, sign: f64) -> Float<f64>

A number composed of its magnitude and the sign of other.

Source

pub fn mul_add(self, mul: f64, add: f64) -> Float<f64>

Fused multiply-add. Computes (self * mul) + add with only one rounding error.

Source

pub fn powf(self, p: f64) -> Float<f64>

Raises itself to the p floating point power.

Source

pub fn sqrt(self) -> Float<f64>

Square root.

Source

pub fn exp(self) -> Float<f64>

$e^x$ (the exponential function).

Source

pub fn exp2(self) -> Float<f64>

$2^x$.

Source

pub fn exp_m1(self) -> Float<f64>

$e^x -1$, more accurately for small values of x.

Source

pub fn ln(self) -> Float<f64>

The natural logarithm.

Source

pub fn ln_1p(self) -> Float<f64>

The natural logarithm plus 1, more accurately.

Source

pub fn log2(self) -> Float<f64>

The base 2 logarithm.

Source

pub fn log10(self) -> Float<f64>

The base 10 logarithm.

Source

pub fn cbrt(self) -> Float<f64>

The cubic root.

Source

pub fn hypot(self, other: f64) -> Float<f64>

The hypothenuse (the euclidean distance).

Source

pub fn sin(self) -> Float<f64>

The sine.

Source

pub fn cos(self) -> Float<f64>

The cosine.

Source

pub fn tan(self) -> Float<f64>

The tangent.

Source

pub fn asin(self) -> Float<f64>

The arc sine.

Source

pub fn acos(self) -> Float<f64>

The arc cosine.

Source

pub fn atan(self) -> Float<f64>

The arc tangent.

Source

pub fn atan2(self, other: f64) -> Float<f64>

The arc tangent of two variables.

Source

pub fn sinh(self) -> Float<f64>

The hyperbolic sine.

Source

pub fn cosh(self) -> Float<f64>

The hyperbolic cosine.

Source

pub fn tanh(self) -> Float<f64>

The hyperbolic tangent.

Source

pub fn asinh(self) -> Float<f64>

The inverse hyperbolic sine.

Source

pub fn acosh(self) -> Float<f64>

The inverse hyperbolic cosine.

Source

pub fn atanh(self) -> Float<f64>

The inverse hyperbolic tangent.

Source

pub fn max(self, other: f64) -> Float<f64>

The minimum of two numbers, ignoring NaN.

Source

pub fn min(self, other: f64) -> Float<f64>

The minimum of two numbers, ignoring NaN.

Source

pub fn exp10(self) -> Float<f64>

10^x.

Source

pub fn gamma(self) -> Float<f64>

The gamma function. Generalizes the factorial function to complex numbers.

Source

pub fn lgamma(self) -> Float<f64>

The natural logarithm of the absolute value of the gamma function.

Source

pub fn erf(self) -> Float<f64>

The error function.

Source

pub fn erfc(self) -> Float<f64>

The complementary error function (1 - erf).

Source

pub fn j0(self) -> Float<f64>

The bessel function of the first kind, of order 0.

Source

pub fn j1(self) -> Float<f64>

The bessel function of the first kind, of order 1.

Source

pub fn y0(self) -> Float<f64>

The bessel function of the second kind, of order 0.

Source

pub fn y1(self) -> Float<f64>

The bessel function of the second kind, of order 1.

Source§

impl Float<f32>

Available on crate feature _float_f32 only.

§Implementations using the libm feature.

Source

pub fn fract(self) -> Float<f32>

The fractional part.

§Formulation

$$ \text{fract}(x) = x - \text{trunc}(x) $$

Source

pub fn split(self) -> (Float<f32>, Float<f32>)

The integral and fractional parts.

§Formulation

$$ \text{split}(x) = (\text{trunc}(x), \text{fract}(x)) $$

Source

pub fn signum(self) -> Float<f32>

A number that represents the sign of x, propagating NaN.

Source

pub fn round_ties_even(self) -> Float<f32>

Returns the nearest integer to x, rounding ties to the nearest even integer.

Source

pub fn clamp(self, min: f32, max: f32) -> Float<f32>

Returns itself clamped between min and max, ignoring NaN.

Source

pub fn powi(self, p: i32) -> Float<f32>

Raises x to the p integer power.

Source

pub fn log(self, base: f32) -> Float<f32>

The logarithm of the number with respect to an arbitrary base.

Source

pub fn sin_cos(self) -> (Float<f32>, Float<f32>)

The sine and cosine.

Source

pub fn lgamma_r(self) -> (Float<f32>, i32)

The natural logarithm of the absolute value of the gamma function, plus its sign.

Source

pub fn jn(self, n: i32) -> Float<f32>

Bessel function of the first kind, of order n.

Source

pub fn yn(self, n: i32) -> Float<f32>

Bessel function of the second kind, of order n.

Source§

impl Float<f64>

Available on crate feature _float_f64 only.

§Implementations using the libm feature.

Source

pub fn fract(self) -> Float<f64>

The fractional part.

§Formulation

$$ \text{fract}(x) = x - \text{trunc}(x) $$

Source

pub fn split(self) -> (Float<f64>, Float<f64>)

The integral and fractional parts.

§Formulation

$$ \text{split}(x) = (\text{trunc}(x), \text{fract}(x)) $$

Source

pub fn signum(self) -> Float<f64>

A number that represents the sign of x, propagating NaN.

Source

pub fn round_ties_even(self) -> Float<f64>

Returns the nearest integer to x, rounding ties to the nearest even integer.

Source

pub fn clamp(self, min: f64, max: f64) -> Float<f64>

Returns itself clamped between min and max, ignoring NaN.

Source

pub fn powi(self, p: i32) -> Float<f64>

Raises x to the p integer power.

Source

pub fn log(self, base: f64) -> Float<f64>

The logarithm of the number with respect to an arbitrary base.

Source

pub fn sin_cos(self) -> (Float<f64>, Float<f64>)

The sine and cosine.

Source

pub fn lgamma_r(self) -> (Float<f64>, i32)

The natural logarithm of the absolute value of the gamma function, plus its sign.

Source

pub fn jn(self, n: i32) -> Float<f64>

Bessel function of the first kind, of order n.

Source

pub fn yn(self, n: i32) -> Float<f64>

Bessel function of the second kind, of order n.

Source§

impl Float<f32>

Available on crate feature _float_f32 only.

§Common implementations with or without std or libm.

Source

pub const fn const_floor(self) -> Float<f32>

The largest integer less than or equal to itself.

§Formulation

$$ \large \lfloor x \rfloor = \max { n \in \mathbb{Z} ,|, n \leq x } $$

Source

pub const fn const_ceil(self) -> Float<f32>

The smallest integer greater than or equal to itself.

§Formulation

$$ $$ \lceil x \rceil = \min { n \in \mathbb{Z} ,|, n \geq x } $$

Source

pub const fn const_round(self) -> Float<f32>

The nearest integer to itself, default rounding

This is the default [round_ties_away] implementation.

Source

pub const fn const_round_ties_away(self) -> Float<f32>

The nearest integer to itself, rounding ties away from 0.0.

This is the default [round] implementation.

§Formulation

$$ \text{round\_ties\_away}(x) = \begin{cases} \lceil x \rceil, & \text{if } x - \lfloor x \rfloor > 0.5 \text{ or } (x - \lfloor x \rfloor = 0.5 \text{ and } x > 0) \cr \lfloor x \rfloor, & \text{if } x - \lfloor x \rfloor < 0.5 \text{ or } (x - \lfloor x \rfloor = 0.5 \text{ and } x < 0) \end{cases} $$

Source

pub const fn const_round_ties_even(self) -> Float<f32>

Returns the nearest integer to x, rounding ties to the nearest even integer.

§Formulation

$$ \text{round\_ties\_even}(x) = \begin{cases} \lceil x \rceil, & \text{if } x - \lfloor x \rfloor > 0.5 \cr \lfloor x \rfloor, & \text{if } x - \lfloor x \rfloor < 0.5 \cr \lfloor x \rfloor, & \text{if } x - \lfloor x \rfloor = 0.5 \text{ and } \lfloor x \rfloor \text{ is even} \cr \lceil x \rceil, & \text{if } x - \lfloor x \rfloor = 0.5 \text{ and } \lfloor x \rfloor \text{ is odd} \end{cases} $$

Source

pub const fn const_trunc(self) -> Float<f32>

The integral part. This means that non-integer numbers are always truncated towards zero.

§Formulation

$$ \text{trunc}(x) = \begin{cases} \lfloor x \rfloor, & \text{if } x \geq 0 \ \lceil x \rceil, & \text{if } x < 0 \end{cases} $$

This implementation uses bitwise manipulation to remove the fractional part of the floating-point number. The exponent is extracted, and a mask is created to remove the fractional part. The new bits are then used to create the truncated floating-point number.

Source

pub fn const_round_ties_odd(self) -> Float<f32>

Returns the nearest integer, rounding ties to the nearest odd integer.

§Formulation

$$ \text{round\_ties\_odd}(x) = \begin{cases} \lceil x \rceil, & \text{if } x - \lfloor x \rfloor > 0.5 \cr \lfloor x \rfloor, & \text{if } x - \lfloor x \rfloor < 0.5 \cr \lfloor x \rfloor, & \text{if } x - \lfloor x \rfloor = 0.5 \text{ and } \lfloor x \rfloor \text{ is odd} \cr \lceil x \rceil, & \text{if } x - \lfloor x \rfloor = 0.5 \text{ and } \lfloor x \rfloor \text{ is even} \end{cases} $$

Source

pub fn round_ties_odd(self) -> Float<f32>

Returns the nearest integer, rounding ties to the nearest odd integer.

§Formulation

$$ \text{round\_ties\_odd}(x) = \begin{cases} \lceil x \rceil, & \text{if } x - \lfloor x \rfloor > 0.5 \cr \lfloor x \rfloor, & \text{if } x - \lfloor x \rfloor < 0.5 \cr \lfloor x \rfloor, & \text{if } x - \lfloor x \rfloor = 0.5 \text{ and } \lfloor x \rfloor \text{ is odd} \cr \lceil x \rceil, & \text{if } x - \lfloor x \rfloor = 0.5 \text{ and } \lfloor x \rfloor \text{ is even} \end{cases} $$

Source

pub const fn const_fract(self) -> Float<f32>

The fractional part.

§Formulation

$$ \text{fract}(x) = x - \text{trunc}(x) $$

Source

pub const fn const_split(self) -> (Float<f32>, Float<f32>)

The integral and fractional parts.

§Formulation

$$ \text{split}(x) = (\text{trunc}(x), \text{fract}(x)) $$

Source

pub const fn const_signum(self) -> Float<f32>

A number that represents its sign, propagating NaN.

Source

pub const fn const_copysign(self, sign: f32) -> Float<f32>

A number composed of the magnitude of itself and the sign of other.

Source

pub const fn sign(self) -> Sign

Returns the Sign.

Source

pub const fn sign_nonzero(self) -> Sign

Returns the Sign, returning None for zero

Source

pub const fn is_sign_positive(self) -> bool

Returns true if self has a positive sign.

Source

pub const fn is_sign_negative(self) -> bool

Returns true if self has a negative sign.

Source

pub const fn is_zero(self) -> bool

Returns true if self is 0.0 or -0.0.

Source

pub const fn is_sign_positive_nonzero(self) -> bool

Returns true if self has a positive sign and is not zero.

Source

pub const fn is_sign_negative_nonzero(self) -> bool

Returns true if self has a negative sign and is not zero.

Source

pub const fn mul_add_fallback(self, mul: f32, add: f32) -> Float<f32>

Computes (x * mul + add) normally.

Source

pub fn div_euclid(self, other: f32) -> Float<f32>

The euclidean division.

Source

pub const fn rem_euclid(self, other: f32) -> Float<f32>

The least non-negative remainder of self % other.

Source

pub const fn scale(self, min: f32, max: f32, u: f32, v: f32) -> Float<f32>

Returns self between [min..=max] scaled to a new range [u..=v].

Values of self outside of [min..=max] are not clamped and will result in extrapolation.

§Formulation

$$ \large \text{scale}(x, min, max, u, v) = (v - u) \frac{x - min}{max - min} + u $$

§Examples
assert_eq![Float(45_f32).scale(0., 360., 0., 1.), 0.125];
assert_eq![Float(45_f32).scale(0., 360., -1., 1.), -0.75];
assert_eq![Float(0.125_f32).scale(0., 1., 0., 360.), 45.];
assert_eq![Float(-0.75_f32).scale(-1., 1., 0., 360.), 45.];
Source

pub const fn lerp(self, u: f32, v: f32) -> Float<f32>

Calculates a linearly interpolated value between u..=v based on self as a percentage between [0..=1].

Values of self outside [0..=1] are not clamped and will result in extrapolation.

§Formulation

$$ \large \text{lerp}(x, u, v) = (1 - x) \cdot u + x \cdot v $$

§Example
assert_eq![Float(0.5_f32).lerp(40., 80.), 60.];
Source

pub const fn fisr(self) -> Float<f32>

$ 1 / \sqrt{x} $ the fast inverse square root algorithm.

Source

pub const fn sqrt_nr(self) -> Float<f32>

$ \sqrt{x} $ The square root calculated using the Newton-Raphson method.

Source

pub const fn sqrt_fisr(self) -> Float<f32>

$ \sqrt{x} $ the square root calculated using the fast inverse square root algorithm.

Source

pub const fn hypot_fisr(self, y: f32) -> Float<f32>

The hypothenuse (the euclidean distance) using the fast inverse square root algorithm.

§Formulation

$$ \text{hypot}(x, y) = \sqrt{x^2 + y^2} $$

Source

pub const fn hypot_nr(self, y: f32) -> Float<f32>

The hypothenuse (the euclidean distance) using the Newton-Raphson method.

§Formulation

$$ \text{hypot}(x, y) = \sqrt{x^2 + y^2} $$

Source

pub const fn cbrt_nr(self) -> Float<f32>

$ \sqrt[3]{x} $ The cubic root calculated using the Newton-Raphson method.

Source

pub const fn factorial(x: u32) -> Float<f32>

The factorial of the integer value x.

The maximum values with a representable result are: 34 for f32 and 170 for f64.

Note that precision is poor for large values.

Source

pub const fn abs(self) -> Float<f32>

The absolute value of self.

Source

pub const fn neg_abs(self) -> Float<f32>

The negative absolute value of self (sets its sign to be negative).

Source

pub const fn flip_sign(self) -> Float<f32>

Flips its sign.

Source

pub const fn const_clamp(self, min: f32, max: f32) -> Float<f32>

Returns itself clamped between min and max, ignoring NaN.

§Example
assert_eq![Float(50.0_f32).clamp(40., 80.), 50.];
assert_eq![Float(100.0_f32).clamp(40., 80.), 80.];
assert_eq![Float(10.0_f32).clamp(40., 80.), 40.];

See also: clamp_nan, clamp_total.

Source

pub const fn const_max(self, other: f32) -> Float<f32>

The maximum between itself and other, ignoring NaN.

Source

pub const fn const_min(self, other: f32) -> Float<f32>

The minimum between itself and other, ignoring NaN.

Source

pub const fn clamp_total(self, min: f32, max: f32) -> Float<f32>

Available on crate feature _cmp_f32 only.

Returns itself clamped between min and max, using total order.

§Example
assert_eq![Float(50.0_f32).clamp_total(40., 80.), 50.];
assert_eq![Float(100.0_f32).clamp_total(40., 80.), 80.];
assert_eq![Float(10.0_f32).clamp_total(40., 80.), 40.];

See also: clamp, clamp_nan.

Source

pub const fn max_total(self, other: f32) -> Float<f32>

Available on crate feature _cmp_f32 only.

Returns the maximum between itself and other, using total order.

See also: max_nan.

Source

pub fn min_total(self, other: f32) -> Float<f32>

Available on crate feature _cmp_f32 only.

Returns the minimum between itself and other, using total order.

See also: min_nan.

Source

pub const fn clamp_nan(self, min: f32, max: f32) -> Float<f32>

Returns itself clamped between min and max, propagating NaN.

§Example
assert_eq![Float(50.0_f32).clamp_nan(40., 80.), 50.];
assert_eq![Float(100.0_f32).clamp_nan(40., 80.), 80.];
assert_eq![Float(10.0_f32).clamp_nan(40., 80.), 40.];

See also: clamp, clamp_total.

Source

pub const fn max_nan(self, other: f32) -> Float<f32>

Returns the maximum between itself and other, propagating Nan.

§Example
assert_eq![Float(50.0_f32).max_nan(80.), 80.];
assert_eq![Float(100.0_f32).max_nan(80.), 100.];

See also: max_total.

Source

pub const fn min_nan(self, other: f32) -> Float<f32>

Returns the minimum between itself and other, propagating Nan.

§Example
assert_eq![Float(50.0_f32).min_nan(80.), 50.];
assert_eq![Float(100.0_f32).min_nan(80.), 80.];

See also: min_total.

Source

pub const fn const_powi(self, p: i32) -> Float<f32>

Raises itself to the p integer power.

Source

pub const fn eval_poly(self, coefficients: &[f32]) -> Float<f32>

Evaluates a polynomial at the self point value, using Horner’s method.

Expects a slice of coefficients $[a_n, a_{n-1}, …, a_1, a_0]$ representing the polynomial $ a_n * x^n + a_{n-1} * x^{(n-1)} + … + a_1 * x + a_0 $.

§Examples
let coefficients = [2.0, -6.0, 2.0, -1.0];
assert_eq![Float(3.0_f32).eval_poly(&coefficients), 5.0];
assert_eq![Float(3.0_f32).eval_poly(&[]), 0.0];
Source

pub fn derivative<F>(f: F, x: f32, h: f32) -> Float<f32>
where F: Fn(f32) -> f32,

Approximates the derivative of the 1D function f at x point using step size h.

Uses the finite difference method.

§Formulation

$$ f’(x) \approx \frac{f(x + h) - f(x)}{h} $$

See also the autodiff attr macro, enabled with the nightly_autodiff feature.

Source

pub fn integrate<F>(f: F, x: f32, y: f32, n: usize) -> Float<f32>
where F: Fn(f32) -> f32,

Approximates the integral of the 1D function f over the range [x, y] using n subdivisions.

Uses the Riemann Sum.

§Formulation

$$ \int_a^b f(x) , dx \approx \sum_{i=0}^{n-1} f(x_i) \cdot \Delta x $$ where $$ \Delta x = \frac{b-a}{n} $$

Source

pub fn partial_derivative_x<F>(f: F, x: f32, y: f32, h: f32) -> Float<f32>
where F: Fn(f32, f32) -> f32,

Approximates the partial derivative of the 2D function f at point (x, y) with step size h, differentiating over x.

§Formulation

\frac{\partial f}{\partial x} \approx \frac{f(x + h, y) - f(x, y)}{h} $$

Source

pub fn partial_derivative_y<F>(f: F, x: f32, y: f32, h: f32) -> Float<f32>
where F: Fn(f32, f32) -> f32,

Approximates the partial derivative of the 2D function f at point (x, y) with step size h, differentiating over x.

§Formulation

\frac{\partial f}{\partial x} \approx \frac{f(x + h, y) - f(x, y)}{h} $$

Source§

impl Float<f64>

Available on crate feature _float_f64 only.

§Common implementations with or without std or libm.

Source

pub const fn const_floor(self) -> Float<f64>

The largest integer less than or equal to itself.

§Formulation

$$ \large \lfloor x \rfloor = \max { n \in \mathbb{Z} ,|, n \leq x } $$

Source

pub const fn const_ceil(self) -> Float<f64>

The smallest integer greater than or equal to itself.

§Formulation

$$ $$ \lceil x \rceil = \min { n \in \mathbb{Z} ,|, n \geq x } $$

Source

pub const fn const_round(self) -> Float<f64>

The nearest integer to itself, default rounding

This is the default [round_ties_away] implementation.

Source

pub const fn const_round_ties_away(self) -> Float<f64>

The nearest integer to itself, rounding ties away from 0.0.

This is the default [round] implementation.

§Formulation

$$ \text{round\_ties\_away}(x) = \begin{cases} \lceil x \rceil, & \text{if } x - \lfloor x \rfloor > 0.5 \text{ or } (x - \lfloor x \rfloor = 0.5 \text{ and } x > 0) \cr \lfloor x \rfloor, & \text{if } x - \lfloor x \rfloor < 0.5 \text{ or } (x - \lfloor x \rfloor = 0.5 \text{ and } x < 0) \end{cases} $$

Source

pub const fn const_round_ties_even(self) -> Float<f64>

Returns the nearest integer to x, rounding ties to the nearest even integer.

§Formulation

$$ \text{round\_ties\_even}(x) = \begin{cases} \lceil x \rceil, & \text{if } x - \lfloor x \rfloor > 0.5 \cr \lfloor x \rfloor, & \text{if } x - \lfloor x \rfloor < 0.5 \cr \lfloor x \rfloor, & \text{if } x - \lfloor x \rfloor = 0.5 \text{ and } \lfloor x \rfloor \text{ is even} \cr \lceil x \rceil, & \text{if } x - \lfloor x \rfloor = 0.5 \text{ and } \lfloor x \rfloor \text{ is odd} \end{cases} $$

Source

pub const fn const_trunc(self) -> Float<f64>

The integral part. This means that non-integer numbers are always truncated towards zero.

§Formulation

$$ \text{trunc}(x) = \begin{cases} \lfloor x \rfloor, & \text{if } x \geq 0 \ \lceil x \rceil, & \text{if } x < 0 \end{cases} $$

This implementation uses bitwise manipulation to remove the fractional part of the floating-point number. The exponent is extracted, and a mask is created to remove the fractional part. The new bits are then used to create the truncated floating-point number.

Source

pub fn const_round_ties_odd(self) -> Float<f64>

Returns the nearest integer, rounding ties to the nearest odd integer.

§Formulation

$$ \text{round\_ties\_odd}(x) = \begin{cases} \lceil x \rceil, & \text{if } x - \lfloor x \rfloor > 0.5 \cr \lfloor x \rfloor, & \text{if } x - \lfloor x \rfloor < 0.5 \cr \lfloor x \rfloor, & \text{if } x - \lfloor x \rfloor = 0.5 \text{ and } \lfloor x \rfloor \text{ is odd} \cr \lceil x \rceil, & \text{if } x - \lfloor x \rfloor = 0.5 \text{ and } \lfloor x \rfloor \text{ is even} \end{cases} $$

Source

pub fn round_ties_odd(self) -> Float<f64>

Returns the nearest integer, rounding ties to the nearest odd integer.

§Formulation

$$ \text{round\_ties\_odd}(x) = \begin{cases} \lceil x \rceil, & \text{if } x - \lfloor x \rfloor > 0.5 \cr \lfloor x \rfloor, & \text{if } x - \lfloor x \rfloor < 0.5 \cr \lfloor x \rfloor, & \text{if } x - \lfloor x \rfloor = 0.5 \text{ and } \lfloor x \rfloor \text{ is odd} \cr \lceil x \rceil, & \text{if } x - \lfloor x \rfloor = 0.5 \text{ and } \lfloor x \rfloor \text{ is even} \end{cases} $$

Source

pub const fn const_fract(self) -> Float<f64>

The fractional part.

§Formulation

$$ \text{fract}(x) = x - \text{trunc}(x) $$

Source

pub const fn const_split(self) -> (Float<f64>, Float<f64>)

The integral and fractional parts.

§Formulation

$$ \text{split}(x) = (\text{trunc}(x), \text{fract}(x)) $$

Source

pub const fn const_signum(self) -> Float<f64>

A number that represents its sign, propagating NaN.

Source

pub const fn const_copysign(self, sign: f64) -> Float<f64>

A number composed of the magnitude of itself and the sign of other.

Source

pub const fn sign(self) -> Sign

Returns the Sign.

Source

pub const fn sign_nonzero(self) -> Sign

Returns the Sign, returning None for zero

Source

pub const fn is_sign_positive(self) -> bool

Returns true if self has a positive sign.

Source

pub const fn is_sign_negative(self) -> bool

Returns true if self has a negative sign.

Source

pub const fn is_zero(self) -> bool

Returns true if self is 0.0 or -0.0.

Source

pub const fn is_sign_positive_nonzero(self) -> bool

Returns true if self has a positive sign and is not zero.

Source

pub const fn is_sign_negative_nonzero(self) -> bool

Returns true if self has a negative sign and is not zero.

Source

pub const fn mul_add_fallback(self, mul: f64, add: f64) -> Float<f64>

Computes (x * mul + add) normally.

Source

pub fn div_euclid(self, other: f64) -> Float<f64>

The euclidean division.

Source

pub const fn rem_euclid(self, other: f64) -> Float<f64>

The least non-negative remainder of self % other.

Source

pub const fn scale(self, min: f64, max: f64, u: f64, v: f64) -> Float<f64>

Returns self between [min..=max] scaled to a new range [u..=v].

Values of self outside of [min..=max] are not clamped and will result in extrapolation.

§Formulation

$$ \large \text{scale}(x, min, max, u, v) = (v - u) \frac{x - min}{max - min} + u $$

§Examples
assert_eq![Float(45_f64).scale(0., 360., 0., 1.), 0.125];
assert_eq![Float(45_f64).scale(0., 360., -1., 1.), -0.75];
assert_eq![Float(0.125_f64).scale(0., 1., 0., 360.), 45.];
assert_eq![Float(-0.75_f64).scale(-1., 1., 0., 360.), 45.];
Source

pub const fn lerp(self, u: f64, v: f64) -> Float<f64>

Calculates a linearly interpolated value between u..=v based on self as a percentage between [0..=1].

Values of self outside [0..=1] are not clamped and will result in extrapolation.

§Formulation

$$ \large \text{lerp}(x, u, v) = (1 - x) \cdot u + x \cdot v $$

§Example
assert_eq![Float(0.5_f64).lerp(40., 80.), 60.];
Source

pub const fn fisr(self) -> Float<f64>

$ 1 / \sqrt{x} $ the fast inverse square root algorithm.

Source

pub const fn sqrt_nr(self) -> Float<f64>

$ \sqrt{x} $ The square root calculated using the Newton-Raphson method.

Source

pub const fn sqrt_fisr(self) -> Float<f64>

$ \sqrt{x} $ the square root calculated using the fast inverse square root algorithm.

Source

pub const fn hypot_fisr(self, y: f64) -> Float<f64>

The hypothenuse (the euclidean distance) using the fast inverse square root algorithm.

§Formulation

$$ \text{hypot}(x, y) = \sqrt{x^2 + y^2} $$

Source

pub const fn hypot_nr(self, y: f64) -> Float<f64>

The hypothenuse (the euclidean distance) using the Newton-Raphson method.

§Formulation

$$ \text{hypot}(x, y) = \sqrt{x^2 + y^2} $$

Source

pub const fn cbrt_nr(self) -> Float<f64>

$ \sqrt[3]{x} $ The cubic root calculated using the Newton-Raphson method.

Source

pub const fn factorial(x: u32) -> Float<f64>

The factorial of the integer value x.

The maximum values with a representable result are: 34 for f32 and 170 for f64.

Note that precision is poor for large values.

Source

pub const fn abs(self) -> Float<f64>

The absolute value of self.

Source

pub const fn neg_abs(self) -> Float<f64>

The negative absolute value of self (sets its sign to be negative).

Source

pub const fn flip_sign(self) -> Float<f64>

Flips its sign.

Source

pub const fn const_clamp(self, min: f64, max: f64) -> Float<f64>

Returns itself clamped between min and max, ignoring NaN.

§Example
assert_eq![Float(50.0_f64).clamp(40., 80.), 50.];
assert_eq![Float(100.0_f64).clamp(40., 80.), 80.];
assert_eq![Float(10.0_f64).clamp(40., 80.), 40.];

See also: clamp_nan, clamp_total.

Source

pub const fn const_max(self, other: f64) -> Float<f64>

The maximum between itself and other, ignoring NaN.

Source

pub const fn const_min(self, other: f64) -> Float<f64>

The minimum between itself and other, ignoring NaN.

Source

pub const fn clamp_total(self, min: f64, max: f64) -> Float<f64>

Available on crate feature _cmp_f64 only.

Returns itself clamped between min and max, using total order.

§Example
assert_eq![Float(50.0_f64).clamp_total(40., 80.), 50.];
assert_eq![Float(100.0_f64).clamp_total(40., 80.), 80.];
assert_eq![Float(10.0_f64).clamp_total(40., 80.), 40.];

See also: clamp, clamp_nan.

Source

pub const fn max_total(self, other: f64) -> Float<f64>

Available on crate feature _cmp_f64 only.

Returns the maximum between itself and other, using total order.

See also: max_nan.

Source

pub fn min_total(self, other: f64) -> Float<f64>

Available on crate feature _cmp_f64 only.

Returns the minimum between itself and other, using total order.

See also: min_nan.

Source

pub const fn clamp_nan(self, min: f64, max: f64) -> Float<f64>

Returns itself clamped between min and max, propagating NaN.

§Example
assert_eq![Float(50.0_f64).clamp_nan(40., 80.), 50.];
assert_eq![Float(100.0_f64).clamp_nan(40., 80.), 80.];
assert_eq![Float(10.0_f64).clamp_nan(40., 80.), 40.];

See also: clamp, clamp_total.

Source

pub const fn max_nan(self, other: f64) -> Float<f64>

Returns the maximum between itself and other, propagating Nan.

§Example
assert_eq![Float(50.0_f64).max_nan(80.), 80.];
assert_eq![Float(100.0_f64).max_nan(80.), 100.];

See also: max_total.

Source

pub const fn min_nan(self, other: f64) -> Float<f64>

Returns the minimum between itself and other, propagating Nan.

§Example
assert_eq![Float(50.0_f64).min_nan(80.), 50.];
assert_eq![Float(100.0_f64).min_nan(80.), 80.];

See also: min_total.

Source

pub const fn const_powi(self, p: i32) -> Float<f64>

Raises itself to the p integer power.

Source

pub const fn eval_poly(self, coefficients: &[f64]) -> Float<f64>

Evaluates a polynomial at the self point value, using Horner’s method.

Expects a slice of coefficients $[a_n, a_{n-1}, …, a_1, a_0]$ representing the polynomial $ a_n * x^n + a_{n-1} * x^{(n-1)} + … + a_1 * x + a_0 $.

§Examples
let coefficients = [2.0, -6.0, 2.0, -1.0];
assert_eq![Float(3.0_f64).eval_poly(&coefficients), 5.0];
assert_eq![Float(3.0_f64).eval_poly(&[]), 0.0];
Source

pub fn derivative<F>(f: F, x: f64, h: f64) -> Float<f64>
where F: Fn(f64) -> f64,

Approximates the derivative of the 1D function f at x point using step size h.

Uses the finite difference method.

§Formulation

$$ f’(x) \approx \frac{f(x + h) - f(x)}{h} $$

See also the autodiff attr macro, enabled with the nightly_autodiff feature.

Source

pub fn integrate<F>(f: F, x: f64, y: f64, n: usize) -> Float<f64>
where F: Fn(f64) -> f64,

Approximates the integral of the 1D function f over the range [x, y] using n subdivisions.

Uses the Riemann Sum.

§Formulation

$$ \int_a^b f(x) , dx \approx \sum_{i=0}^{n-1} f(x_i) \cdot \Delta x $$ where $$ \Delta x = \frac{b-a}{n} $$

Source

pub fn partial_derivative_x<F>(f: F, x: f64, y: f64, h: f64) -> Float<f64>
where F: Fn(f64, f64) -> f64,

Approximates the partial derivative of the 2D function f at point (x, y) with step size h, differentiating over x.

§Formulation

\frac{\partial f}{\partial x} \approx \frac{f(x + h, y) - f(x, y)}{h} $$

Source

pub fn partial_derivative_y<F>(f: F, x: f64, y: f64, h: f64) -> Float<f64>
where F: Fn(f64, f64) -> f64,

Approximates the partial derivative of the 2D function f at point (x, y) with step size h, differentiating over x.

§Formulation

\frac{\partial f}{\partial x} \approx \frac{f(x + h, y) - f(x, y)}{h} $$

Source§

impl Float<f32>

Available on crate feature _float_f32 only.

§Common methods with or without std or libm.

Implemented using Taylor series.

Source

pub const fn powf_series(self, y: f32, ln_x_terms: u32) -> Float<f32>

Raises itself to the y floating point power using the Taylor series via the exp and ln functions.

§Formulation

$$ \large x^y = e^{y \cdot \ln(x)} $$

See also ln_series_terms.

The terms for the exponential function are calculated using exp_series_terms using $y\cdot\ln(x)$.

Source

pub const fn exp_series(self, terms: u32) -> Float<f32>

Computes the exponential function $e^x$ using Taylor series expansion.

§Formulation

$$ e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!} + \cdots $$ For values $ x < 0 $ it uses the identity: $$ e^x = \frac{1}{e^-x} $$

See also exp_series_terms.

Source

pub const fn exp_series_terms(self) -> u32

Determines the number of terms needed for exp_series to reach a stable result based on the input value. The following table shows the required number of terms needed to reach the most precise result for both f32 and f64:

  value     t_f32  t_f64
-------------------------
± 0.001 →       3     5
± 0.100 →       6     10
± 1.000 →      11     18
± 10.000 →     32     46
± 20.000 →     49     68
± 50.000 →     92    119
± 88.722 →    143    177  (max for f32 == f32::MAX.ln())
± 150.000 →   ---    261
± 300.000 →   ---    453
± 500.000 →   ---    692
± 709.782 →   ---    938  (max for f64 == f64:MAX.ln())
Source

pub const fn exp_m1_series(self, terms: u32) -> Float<f32>

Calculates $ e^x - 1 $ using the Taylor series expansion.

§Formulation

$$ e^x -1 = x + \frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!} + \cdots $$ For values $ x < 0 $ it uses the identity: $$ e^x -1 = -\frac{1}{e^{-x}+1} $$ For values $ x > 0.001 $ it uses exp_series.

See also exp_series_terms.

Source

pub const fn exp2_series(self, terms: u32) -> Float<f32>

Calculates $ 2^x $ using the Taylor series expansion.

§Formulation

The series based on the formula $ 2^x = e^{x \ln(2)} $ is: $$ 2^x = 1 + x \ln(2) + \frac{(x \ln(2))^2}{2!} + \frac{(x \ln(2))^3}{3!} + \frac{(x \ln(2))^4}{4!} + \cdots $$

The maximum values with a representable result are: 127 for f32 and 1023 for f64.

Source

pub const fn exp2_series_terms(self) -> u32

Determines the number of terms needed for exp2_series to reach a stable result based on the input value. The following table shows the required number of terms needed to reach the most precise result for both f32 and f64:

  value     t_f32  t_f64
-------------------------
± 0.3 →        8     13
± 3.0 →       15     25
± 7.0 →       22     34
± 15.0 →      34     49
± 31.0 →      52     71
± 63.0 →      84    110
± 127.999 →  144    178 (max for f32)
± 255.0 →    ---    298
± 511.0 →    ---    520
± 1023.999 → ---    939 (max for f64)
Source

pub const fn ln_series(self, terms: u32) -> Float<f32>

Computes the natural logarithm of self using a Taylor-Mercator series expansion.

This method is more efficient for values of self near 1. Values too small or too big could be impractical to calculate with precision.

§Formulation

$$ \ln(x) = 2 \left( \frac{x-1}{x+1} + \frac{1}{3} \left( \frac{x-1}{x+1} \right)^3 + \frac{1}{5} \left( \frac{x-1}{x+1} \right)^5 + \cdots \right) $$

See also ln_series_terms.

Source

pub const fn ln_1p_series(self, terms: u32) -> Float<f32>

Computes the natural logarithm of 1 + self using a Taylor-Mercator series expansion.

This method is more efficient for values of self near 0. Values too small or too big could be impractical to calculate with precision.

Returns ln(1+self) more accurately than if the operations were performed separately.

See also ln_series_terms.

Source

pub const fn log_series(self, base: f32, terms: u32) -> Float<f32>

Computes the logarithm to the given base using the change of base formula.

§Formulation

$$ \log_{\text{base}}(x) = \frac{\ln(x)}{\ln(\text{base})} $$

See also ln_series_terms.

Source

pub const fn log2_series(self, terms: u32) -> Float<f32>

Computes the base-2 logarithm using the change of base formula.

§Formulation

$$ \log_{2}(x) = \frac{\ln(x)}{\ln(2)} $$

See also ln_series_terms.

Source

pub const fn log10_series(self, terms: u32) -> Float<f32>

Computes the base-10 logarithm using the change of base formula.

§Formulation

$$ \log_{10}(x) = \frac{\ln(x)}{\ln(10)} $$

See also ln_series_terms.

Source

pub const fn ln_series_terms(self) -> u32

Determines the number of terms needed for exp2_series to reach a stable result based on the input value. The following table shows the required number of terms needed to reach the most precise result for both f32 and f64:

  value      t_f32  t_f64
--------------------------
± 0.00001 →  81181 536609
± 0.0001 →   12578  59174
± 0.001 →     1923   6639
± 0.01. →      245    720
± 0.1 →         32     80
± 0.5 →          8     17
± 1. →           1      1
± 2. →           8     17
± 10. →         32     80
± 100. →       245    720
± 1000. →     1923   6639
± 10000. →   12578  59174
± 100000. →  81181 536609
/// ```
Source

pub const fn sin_series(self, terms: u32) -> Float<f32>

The sine calculated using Taylor series expansion.

§Formulation

$$ \sin(x) = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots $$

This Taylor series converges relatively quickly and uniformly over the entire domain. The following table shows the required number of terms needed to reach the most precise result for both f32 and f64:

  value     t_f32  t_f64
-------------------------
± 0.001 →      3      4
± 0.100 →      4      6
± 0.300 →      5      7
± 0.500 →      5      8
± 0.700 →      6      9
± 0.900 →      6     10
± 0.999 →      6     10
Source

pub const fn cos_series(self, terms: u32) -> Float<f32>

Computes the cosine using taylor series expansion.

§Formulation

$$ \cos(x) = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \cdots $$

This Taylor series converges relatively quickly and uniformly over the entire domain. The following table shows the required number of terms needed to reach the most precise result for both f32 and f64:

  value     t_f32  t_f64
-------------------------
± 0.001 →      3      4
± 0.100 →      4      6
± 0.300 →      5      8
± 0.500 →      6      9
± 0.700 →      6     10
± 0.900 →      7     10
± 0.999 →      7     11
Source

pub const fn sin_cos_series(self, terms: u32) -> (Float<f32>, Float<f32>)

Computes the sine and the cosine using Taylor series expansion.

Source

pub const fn tan_series(self, terms: u32) -> Float<f32>

Computes the tangent using Taylor series expansion of sine and cosine.

§Formulation

$$ \tan(x) = \frac{\sin(x)}{\cos(x)} $$

The tangent function has singularities and is not defined for cos(x) = 0. This function clamps self within an appropriate range to avoid such issues.

The Taylor series for sine and cosine converge relatively quickly and uniformly over the entire domain. The following table shows the required number of terms needed to reach the most precise result for both f32 and f64:

  value     t_f32  t_f64
-------------------------
± 0.001 →      3      4
± 0.100 →      4      6
± 0.300 →      5      8
± 0.500 →      6      9
± 0.700 →      6     10
± 0.900 →      7     10
± 0.999 →      7     11
Source

pub const fn asin_series(self, terms: u32) -> Float<f32>

Computes the arcsine using Taylor series expansion.

§Formulation

$$ \arcsin(x) = x + \left( \frac{1}{2} \right) \frac{x^3}{3} + \left( \frac{1}{2} \cdot \frac{3}{4} \right) \frac{x^5}{5} + \left( \frac{1}{2} \cdot \frac{3}{4} \cdot \frac{5}{6} \right) \frac{x^7}{7} + \cdots $$

asin is undefined for $ |x| > 1 $ and in that case returns NaN.

The series converges more slowly near the edges of the domain (i.e., as self approaches -1 or 1). For more accurate results, especially near these boundary values, a higher number of terms may be necessary.

See also asin_series_terms.

Source

pub const fn asin_series_terms(self) -> u32

Determines the number of terms needed for asin_series to reach a stable result based on the input value.

The following table shows the required number of terms needed to reach the most precise result for both f32 and f64:

  value     t_f32  t_f64
-------------------------
± 0.001 →      3      4
± 0.100 →      5      9
± 0.300 →      7     15
± 0.500 →     10     24
± 0.700 →     18     44
± 0.900 →     47    134
± 0.990 →    333   1235
± 0.999 →   1989  10768
Source

pub const fn acos_series(self, terms: u32) -> Float<f32>

Computes the arccosine using the Taylor expansion of arcsine.

§Formulation

$$ \arccos(x)=2π-arcsin(x) $$

See the asin_series_terms table for information about the number of terms needed.

Source

pub const fn acos_series_terms(self) -> u32

Determines the number of terms needed for acos_series to reach a stable result based on the input value.

The table is the same as asin_series_terms.

Source

pub const fn atan_series(self, terms: u32) -> Float<f32>

Computes the arctangent using Taylor series expansion.

§Formulation

$$ \arctan(x) = x - \frac{x^3}{3} + \frac{x^5}{5} - \frac{x^7}{7} + \cdots $$ For values $ |x| > 1 $ it uses the identity: $$ \arctan(x) = \frac{\pi}{2} - \arctan(\frac{1}{x}) $$

The series converges more slowly near the edges of the domain (i.e., as self approaches -1 or 1). For more accurate results, especially near these boundary values, a higher number of terms may be necessary.

See also atan_series_terms.

Source

pub const fn atan_series_terms(self) -> u32

Determines the number of terms needed for atan_series to reach a stable result based on the input value. The following table shows the required number of terms needed to reach the most precise result for both f32 and f64:

  value     t_f32  t_f64
-------------------------
± 0.001 →      3      4
± 0.100 →      5      9
± 0.300 →      7     15
± 0.500 →     12     26
± 0.700 →     20     47
± 0.900 →     61    152
± 0.990 →    518   1466
± 0.999 →   4151  13604
Source

pub const fn atan2_series(self, other: f32, terms: u32) -> Float<f32>

Computes the four quadrant arctangent of self and other using Taylor series expansion.

See also atan_series_terms.

Source

pub const fn sinh_series(self, terms: u32) -> Float<f32>

The hyperbolic sine calculated using Taylor series expansion via the exponent formula.

§Formulation

$$ \sinh(x) = \frac{e^x - e^{-x}}{2} $$

See the exp_series_terms table for information about the number of terms needed.

Source

pub const fn cosh_series(self, terms: u32) -> Float<f32>

The hyperbolic cosine calculated using Taylor series expansion via the exponent formula.

§Formulation

$$ \cosh(x) = \frac{e^x + e^{-x}}{2} $$

See the exp_series_terms table for information about the number of terms needed.

Source

pub const fn tanh_series(self, terms: u32) -> Float<f32>

Computes the hyperbolic tangent using Taylor series expansion of hyperbolic sine and cosine.

§Formulation

$$ \tanh(x) = \frac{\sinh(x)}{\cosh(x)} $$

See the exp_series_terms table for information about the number of terms needed.

Source

pub const fn asinh_series(self, terms: u32) -> Float<f32>

Computes the inverse hyperbolic sine using the natural logarithm definition.

§Formulation

$$ \text{asinh}(x) = \ln(x + \sqrt{x^2 + 1}) $$

See also ln_series_terms.

Source

pub const fn acosh_series(self, terms: u32) -> Float<f32>

Computes the inverse hyperbolic cosine using the natural logarithm definition.

§Formulation

$$ \text{acosh}(x) = \ln(x + \sqrt{x^2 - 1}) $$

See also ln_series_terms.

Source

pub const fn atanh_series(self, terms: u32) -> Float<f32>

Computes the inverse hyperbolic tangent using the natural logarithm definition.

§Formulation

$$ \text{atanh}(x) = \frac{1}{2} \ln\left(\frac{1 + x}{1 - x}\right) $$

See also ln_series_terms.

Source§

impl Float<f64>

Available on crate feature _float_f64 only.

§Common methods with or without std or libm.

Implemented using Taylor series.

Source

pub const fn powf_series(self, y: f64, ln_x_terms: u32) -> Float<f64>

Raises itself to the y floating point power using the Taylor series via the exp and ln functions.

§Formulation

$$ \large x^y = e^{y \cdot \ln(x)} $$

See also ln_series_terms.

The terms for the exponential function are calculated using exp_series_terms using $y\cdot\ln(x)$.

Source

pub const fn exp_series(self, terms: u32) -> Float<f64>

Computes the exponential function $e^x$ using Taylor series expansion.

§Formulation

$$ e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!} + \cdots $$ For values $ x < 0 $ it uses the identity: $$ e^x = \frac{1}{e^-x} $$

See also exp_series_terms.

Source

pub const fn exp_series_terms(self) -> u32

Determines the number of terms needed for exp_series to reach a stable result based on the input value. The following table shows the required number of terms needed to reach the most precise result for both f32 and f64:

  value     t_f32  t_f64
-------------------------
± 0.001 →       3     5
± 0.100 →       6     10
± 1.000 →      11     18
± 10.000 →     32     46
± 20.000 →     49     68
± 50.000 →     92    119
± 88.722 →    143    177  (max for f32 == f32::MAX.ln())
± 150.000 →   ---    261
± 300.000 →   ---    453
± 500.000 →   ---    692
± 709.782 →   ---    938  (max for f64 == f64:MAX.ln())
Source

pub const fn exp_m1_series(self, terms: u32) -> Float<f64>

Calculates $ e^x - 1 $ using the Taylor series expansion.

§Formulation

$$ e^x -1 = x + \frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!} + \cdots $$ For values $ x < 0 $ it uses the identity: $$ e^x -1 = -\frac{1}{e^{-x}+1} $$ For values $ x > 0.001 $ it uses exp_series.

See also exp_series_terms.

Source

pub const fn exp2_series(self, terms: u32) -> Float<f64>

Calculates $ 2^x $ using the Taylor series expansion.

§Formulation

The series based on the formula $ 2^x = e^{x \ln(2)} $ is: $$ 2^x = 1 + x \ln(2) + \frac{(x \ln(2))^2}{2!} + \frac{(x \ln(2))^3}{3!} + \frac{(x \ln(2))^4}{4!} + \cdots $$

The maximum values with a representable result are: 127 for f32 and 1023 for f64.

Source

pub const fn exp2_series_terms(self) -> u32

Determines the number of terms needed for exp2_series to reach a stable result based on the input value. The following table shows the required number of terms needed to reach the most precise result for both f32 and f64:

  value     t_f32  t_f64
-------------------------
± 0.3 →        8     13
± 3.0 →       15     25
± 7.0 →       22     34
± 15.0 →      34     49
± 31.0 →      52     71
± 63.0 →      84    110
± 127.999 →  144    178 (max for f32)
± 255.0 →    ---    298
± 511.0 →    ---    520
± 1023.999 → ---    939 (max for f64)
Source

pub const fn ln_series(self, terms: u32) -> Float<f64>

Computes the natural logarithm of self using a Taylor-Mercator series expansion.

This method is more efficient for values of self near 1. Values too small or too big could be impractical to calculate with precision.

§Formulation

$$ \ln(x) = 2 \left( \frac{x-1}{x+1} + \frac{1}{3} \left( \frac{x-1}{x+1} \right)^3 + \frac{1}{5} \left( \frac{x-1}{x+1} \right)^5 + \cdots \right) $$

See also ln_series_terms.

Source

pub const fn ln_1p_series(self, terms: u32) -> Float<f64>

Computes the natural logarithm of 1 + self using a Taylor-Mercator series expansion.

This method is more efficient for values of self near 0. Values too small or too big could be impractical to calculate with precision.

Returns ln(1+self) more accurately than if the operations were performed separately.

See also ln_series_terms.

Source

pub const fn log_series(self, base: f64, terms: u32) -> Float<f64>

Computes the logarithm to the given base using the change of base formula.

§Formulation

$$ \log_{\text{base}}(x) = \frac{\ln(x)}{\ln(\text{base})} $$

See also ln_series_terms.

Source

pub const fn log2_series(self, terms: u32) -> Float<f64>

Computes the base-2 logarithm using the change of base formula.

§Formulation

$$ \log_{2}(x) = \frac{\ln(x)}{\ln(2)} $$

See also ln_series_terms.

Source

pub const fn log10_series(self, terms: u32) -> Float<f64>

Computes the base-10 logarithm using the change of base formula.

§Formulation

$$ \log_{10}(x) = \frac{\ln(x)}{\ln(10)} $$

See also ln_series_terms.

Source

pub const fn ln_series_terms(self) -> u32

Determines the number of terms needed for exp2_series to reach a stable result based on the input value. The following table shows the required number of terms needed to reach the most precise result for both f32 and f64:

  value      t_f32  t_f64
--------------------------
± 0.00001 →  81181 536609
± 0.0001 →   12578  59174
± 0.001 →     1923   6639
± 0.01. →      245    720
± 0.1 →         32     80
± 0.5 →          8     17
± 1. →           1      1
± 2. →           8     17
± 10. →         32     80
± 100. →       245    720
± 1000. →     1923   6639
± 10000. →   12578  59174
± 100000. →  81181 536609
/// ```
Source

pub const fn sin_series(self, terms: u32) -> Float<f64>

The sine calculated using Taylor series expansion.

§Formulation

$$ \sin(x) = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots $$

This Taylor series converges relatively quickly and uniformly over the entire domain. The following table shows the required number of terms needed to reach the most precise result for both f32 and f64:

  value     t_f32  t_f64
-------------------------
± 0.001 →      3      4
± 0.100 →      4      6
± 0.300 →      5      7
± 0.500 →      5      8
± 0.700 →      6      9
± 0.900 →      6     10
± 0.999 →      6     10
Source

pub const fn cos_series(self, terms: u32) -> Float<f64>

Computes the cosine using taylor series expansion.

§Formulation

$$ \cos(x) = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \cdots $$

This Taylor series converges relatively quickly and uniformly over the entire domain. The following table shows the required number of terms needed to reach the most precise result for both f32 and f64:

  value     t_f32  t_f64
-------------------------
± 0.001 →      3      4
± 0.100 →      4      6
± 0.300 →      5      8
± 0.500 →      6      9
± 0.700 →      6     10
± 0.900 →      7     10
± 0.999 →      7     11
Source

pub const fn sin_cos_series(self, terms: u32) -> (Float<f64>, Float<f64>)

Computes the sine and the cosine using Taylor series expansion.

Source

pub const fn tan_series(self, terms: u32) -> Float<f64>

Computes the tangent using Taylor series expansion of sine and cosine.

§Formulation

$$ \tan(x) = \frac{\sin(x)}{\cos(x)} $$

The tangent function has singularities and is not defined for cos(x) = 0. This function clamps self within an appropriate range to avoid such issues.

The Taylor series for sine and cosine converge relatively quickly and uniformly over the entire domain. The following table shows the required number of terms needed to reach the most precise result for both f32 and f64:

  value     t_f32  t_f64
-------------------------
± 0.001 →      3      4
± 0.100 →      4      6
± 0.300 →      5      8
± 0.500 →      6      9
± 0.700 →      6     10
± 0.900 →      7     10
± 0.999 →      7     11
Source

pub const fn asin_series(self, terms: u32) -> Float<f64>

Computes the arcsine using Taylor series expansion.

§Formulation

$$ \arcsin(x) = x + \left( \frac{1}{2} \right) \frac{x^3}{3} + \left( \frac{1}{2} \cdot \frac{3}{4} \right) \frac{x^5}{5} + \left( \frac{1}{2} \cdot \frac{3}{4} \cdot \frac{5}{6} \right) \frac{x^7}{7} + \cdots $$

asin is undefined for $ |x| > 1 $ and in that case returns NaN.

The series converges more slowly near the edges of the domain (i.e., as self approaches -1 or 1). For more accurate results, especially near these boundary values, a higher number of terms may be necessary.

See also asin_series_terms.

Source

pub const fn asin_series_terms(self) -> u32

Determines the number of terms needed for asin_series to reach a stable result based on the input value.

The following table shows the required number of terms needed to reach the most precise result for both f32 and f64:

  value     t_f32  t_f64
-------------------------
± 0.001 →      3      4
± 0.100 →      5      9
± 0.300 →      7     15
± 0.500 →     10     24
± 0.700 →     18     44
± 0.900 →     47    134
± 0.990 →    333   1235
± 0.999 →   1989  10768
Source

pub const fn acos_series(self, terms: u32) -> Float<f64>

Computes the arccosine using the Taylor expansion of arcsine.

§Formulation

$$ \arccos(x)=2π-arcsin(x) $$

See the asin_series_terms table for information about the number of terms needed.

Source

pub const fn acos_series_terms(self) -> u32

Determines the number of terms needed for acos_series to reach a stable result based on the input value.

The table is the same as asin_series_terms.

Source

pub const fn atan_series(self, terms: u32) -> Float<f64>

Computes the arctangent using Taylor series expansion.

§Formulation

$$ \arctan(x) = x - \frac{x^3}{3} + \frac{x^5}{5} - \frac{x^7}{7} + \cdots $$ For values $ |x| > 1 $ it uses the identity: $$ \arctan(x) = \frac{\pi}{2} - \arctan(\frac{1}{x}) $$

The series converges more slowly near the edges of the domain (i.e., as self approaches -1 or 1). For more accurate results, especially near these boundary values, a higher number of terms may be necessary.

See also atan_series_terms.

Source

pub const fn atan_series_terms(self) -> u32

Determines the number of terms needed for atan_series to reach a stable result based on the input value. The following table shows the required number of terms needed to reach the most precise result for both f32 and f64:

  value     t_f32  t_f64
-------------------------
± 0.001 →      3      4
± 0.100 →      5      9
± 0.300 →      7     15
± 0.500 →     12     26
± 0.700 →     20     47
± 0.900 →     61    152
± 0.990 →    518   1466
± 0.999 →   4151  13604
Source

pub const fn atan2_series(self, other: f64, terms: u32) -> Float<f64>

Computes the four quadrant arctangent of self and other using Taylor series expansion.

See also atan_series_terms.

Source

pub const fn sinh_series(self, terms: u32) -> Float<f64>

The hyperbolic sine calculated using Taylor series expansion via the exponent formula.

§Formulation

$$ \sinh(x) = \frac{e^x - e^{-x}}{2} $$

See the exp_series_terms table for information about the number of terms needed.

Source

pub const fn cosh_series(self, terms: u32) -> Float<f64>

The hyperbolic cosine calculated using Taylor series expansion via the exponent formula.

§Formulation

$$ \cosh(x) = \frac{e^x + e^{-x}}{2} $$

See the exp_series_terms table for information about the number of terms needed.

Source

pub const fn tanh_series(self, terms: u32) -> Float<f64>

Computes the hyperbolic tangent using Taylor series expansion of hyperbolic sine and cosine.

§Formulation

$$ \tanh(x) = \frac{\sinh(x)}{\cosh(x)} $$

See the exp_series_terms table for information about the number of terms needed.

Source

pub const fn asinh_series(self, terms: u32) -> Float<f64>

Computes the inverse hyperbolic sine using the natural logarithm definition.

§Formulation

$$ \text{asinh}(x) = \ln(x + \sqrt{x^2 + 1}) $$

See also ln_series_terms.

Source

pub const fn acosh_series(self, terms: u32) -> Float<f64>

Computes the inverse hyperbolic cosine using the natural logarithm definition.

§Formulation

$$ \text{acosh}(x) = \ln(x + \sqrt{x^2 - 1}) $$

See also ln_series_terms.

Source

pub const fn atanh_series(self, terms: u32) -> Float<f64>

Computes the inverse hyperbolic tangent using the natural logarithm definition.

§Formulation

$$ \text{atanh}(x) = \frac{1}{2} \ln\left(\frac{1 + x}{1 - x}\right) $$

See also ln_series_terms.

Trait Implementations§

Source§

impl<'s, 'o> Add<&'o Float<f32>> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the + operator.
Source§

fn add(self, other: &'o Float<f32>) -> Float<f32>

Performs the + operation. Read more
Source§

impl<'o> Add<&'o Float<f32>> for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the + operator.
Source§

fn add(self, other: &'o Float<f32>) -> Float<f32>

Performs the + operation. Read more
Source§

impl<'s, 'o> Add<&'o Float<f64>> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the + operator.
Source§

fn add(self, other: &'o Float<f64>) -> Float<f64>

Performs the + operation. Read more
Source§

impl<'o> Add<&'o Float<f64>> for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the + operator.
Source§

fn add(self, other: &'o Float<f64>) -> Float<f64>

Performs the + operation. Read more
Source§

impl<'s, 'o> Add<&'o f32> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the + operator.
Source§

fn add(self, other: &'o f32) -> Float<f32>

Performs the + operation. Read more
Source§

impl<'o> Add<&'o f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the + operator.
Source§

fn add(self, other: &'o f32) -> Float<f32>

Performs the + operation. Read more
Source§

impl<'s, 'o> Add<&'o f64> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the + operator.
Source§

fn add(self, other: &'o f64) -> Float<f64>

Performs the + operation. Read more
Source§

impl<'o> Add<&'o f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the + operator.
Source§

fn add(self, other: &'o f64) -> Float<f64>

Performs the + operation. Read more
Source§

impl<'s> Add<Float<f32>> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the + operator.
Source§

fn add(self, other: Float<f32>) -> Float<f32>

Performs the + operation. Read more
Source§

impl<'s> Add<Float<f64>> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the + operator.
Source§

fn add(self, other: Float<f64>) -> Float<f64>

Performs the + operation. Read more
Source§

impl<'s> Add<f32> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the + operator.
Source§

fn add(self, other: f32) -> Float<f32>

Performs the + operation. Read more
Source§

impl Add<f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the + operator.
Source§

fn add(self, other: f32) -> Float<f32>

Performs the + operation. Read more
Source§

impl<'s> Add<f64> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the + operator.
Source§

fn add(self, other: f64) -> Float<f64>

Performs the + operation. Read more
Source§

impl Add<f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the + operator.
Source§

fn add(self, other: f64) -> Float<f64>

Performs the + operation. Read more
Source§

impl Add for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the + operator.
Source§

fn add(self, other: Float<f32>) -> Float<f32>

Performs the + operation. Read more
Source§

impl Add for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the + operator.
Source§

fn add(self, other: Float<f64>) -> Float<f64>

Performs the + operation. Read more
Source§

impl<'o> AddAssign<&'o Float<f32>> for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn add_assign(&mut self, other: &'o Float<f32>)

Performs the += operation. Read more
Source§

impl<'o> AddAssign<&'o Float<f64>> for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn add_assign(&mut self, other: &'o Float<f64>)

Performs the += operation. Read more
Source§

impl<'o> AddAssign<&'o f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn add_assign(&mut self, other: &'o f32)

Performs the += operation. Read more
Source§

impl<'o> AddAssign<&'o f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn add_assign(&mut self, other: &'o f64)

Performs the += operation. Read more
Source§

impl AddAssign<f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn add_assign(&mut self, other: f32)

Performs the += operation. Read more
Source§

impl AddAssign<f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn add_assign(&mut self, other: f64)

Performs the += operation. Read more
Source§

impl AddAssign for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn add_assign(&mut self, other: Float<f32>)

Performs the += operation. Read more
Source§

impl AddAssign for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn add_assign(&mut self, other: Float<f64>)

Performs the += operation. Read more
Source§

impl<T: Clone> Clone for Float<T>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for Float<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Display> Display for Float<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'s, 'o> Div<&'o Float<f32>> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the / operator.
Source§

fn div(self, other: &'o Float<f32>) -> Float<f32>

Performs the / operation. Read more
Source§

impl<'o> Div<&'o Float<f32>> for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the / operator.
Source§

fn div(self, other: &'o Float<f32>) -> Float<f32>

Performs the / operation. Read more
Source§

impl<'s, 'o> Div<&'o Float<f64>> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the / operator.
Source§

fn div(self, other: &'o Float<f64>) -> Float<f64>

Performs the / operation. Read more
Source§

impl<'o> Div<&'o Float<f64>> for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the / operator.
Source§

fn div(self, other: &'o Float<f64>) -> Float<f64>

Performs the / operation. Read more
Source§

impl<'s, 'o> Div<&'o f32> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the / operator.
Source§

fn div(self, other: &'o f32) -> Float<f32>

Performs the / operation. Read more
Source§

impl<'o> Div<&'o f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the / operator.
Source§

fn div(self, other: &'o f32) -> Float<f32>

Performs the / operation. Read more
Source§

impl<'s, 'o> Div<&'o f64> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the / operator.
Source§

fn div(self, other: &'o f64) -> Float<f64>

Performs the / operation. Read more
Source§

impl<'o> Div<&'o f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the / operator.
Source§

fn div(self, other: &'o f64) -> Float<f64>

Performs the / operation. Read more
Source§

impl<'s> Div<Float<f32>> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the / operator.
Source§

fn div(self, other: Float<f32>) -> Float<f32>

Performs the / operation. Read more
Source§

impl<'s> Div<Float<f64>> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the / operator.
Source§

fn div(self, other: Float<f64>) -> Float<f64>

Performs the / operation. Read more
Source§

impl<'s> Div<f32> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the / operator.
Source§

fn div(self, other: f32) -> Float<f32>

Performs the / operation. Read more
Source§

impl Div<f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the / operator.
Source§

fn div(self, other: f32) -> Float<f32>

Performs the / operation. Read more
Source§

impl<'s> Div<f64> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the / operator.
Source§

fn div(self, other: f64) -> Float<f64>

Performs the / operation. Read more
Source§

impl Div<f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the / operator.
Source§

fn div(self, other: f64) -> Float<f64>

Performs the / operation. Read more
Source§

impl Div for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the / operator.
Source§

fn div(self, other: Float<f32>) -> Float<f32>

Performs the / operation. Read more
Source§

impl Div for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the / operator.
Source§

fn div(self, other: Float<f64>) -> Float<f64>

Performs the / operation. Read more
Source§

impl<'o> DivAssign<&'o Float<f32>> for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn div_assign(&mut self, other: &'o Float<f32>)

Performs the /= operation. Read more
Source§

impl<'o> DivAssign<&'o Float<f64>> for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn div_assign(&mut self, other: &'o Float<f64>)

Performs the /= operation. Read more
Source§

impl<'o> DivAssign<&'o f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn div_assign(&mut self, other: &'o f32)

Performs the /= operation. Read more
Source§

impl<'o> DivAssign<&'o f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn div_assign(&mut self, other: &'o f64)

Performs the /= operation. Read more
Source§

impl DivAssign<f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn div_assign(&mut self, other: f32)

Performs the /= operation. Read more
Source§

impl DivAssign<f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn div_assign(&mut self, other: f64)

Performs the /= operation. Read more
Source§

impl DivAssign for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn div_assign(&mut self, other: Float<f32>)

Performs the /= operation. Read more
Source§

impl DivAssign for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn div_assign(&mut self, other: Float<f64>)

Performs the /= operation. Read more
Source§

impl<'s, 'o> Mul<&'o Float<f32>> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'o Float<f32>) -> Float<f32>

Performs the * operation. Read more
Source§

impl<'o> Mul<&'o Float<f32>> for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'o Float<f32>) -> Float<f32>

Performs the * operation. Read more
Source§

impl<'s, 'o> Mul<&'o Float<f64>> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'o Float<f64>) -> Float<f64>

Performs the * operation. Read more
Source§

impl<'o> Mul<&'o Float<f64>> for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'o Float<f64>) -> Float<f64>

Performs the * operation. Read more
Source§

impl<'s, 'o> Mul<&'o f32> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'o f32) -> Float<f32>

Performs the * operation. Read more
Source§

impl<'o> Mul<&'o f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'o f32) -> Float<f32>

Performs the * operation. Read more
Source§

impl<'s, 'o> Mul<&'o f64> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'o f64) -> Float<f64>

Performs the * operation. Read more
Source§

impl<'o> Mul<&'o f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'o f64) -> Float<f64>

Performs the * operation. Read more
Source§

impl<'s> Mul<Float<f32>> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, other: Float<f32>) -> Float<f32>

Performs the * operation. Read more
Source§

impl<'s> Mul<Float<f64>> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, other: Float<f64>) -> Float<f64>

Performs the * operation. Read more
Source§

impl<'s> Mul<f32> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, other: f32) -> Float<f32>

Performs the * operation. Read more
Source§

impl Mul<f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, other: f32) -> Float<f32>

Performs the * operation. Read more
Source§

impl<'s> Mul<f64> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, other: f64) -> Float<f64>

Performs the * operation. Read more
Source§

impl Mul<f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, other: f64) -> Float<f64>

Performs the * operation. Read more
Source§

impl Mul for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, other: Float<f32>) -> Float<f32>

Performs the * operation. Read more
Source§

impl Mul for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, other: Float<f64>) -> Float<f64>

Performs the * operation. Read more
Source§

impl<'o> MulAssign<&'o Float<f32>> for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn mul_assign(&mut self, other: &'o Float<f32>)

Performs the *= operation. Read more
Source§

impl<'o> MulAssign<&'o Float<f64>> for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn mul_assign(&mut self, other: &'o Float<f64>)

Performs the *= operation. Read more
Source§

impl<'o> MulAssign<&'o f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn mul_assign(&mut self, other: &'o f32)

Performs the *= operation. Read more
Source§

impl<'o> MulAssign<&'o f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn mul_assign(&mut self, other: &'o f64)

Performs the *= operation. Read more
Source§

impl MulAssign<f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn mul_assign(&mut self, other: f32)

Performs the *= operation. Read more
Source§

impl MulAssign<f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn mul_assign(&mut self, other: f64)

Performs the *= operation. Read more
Source§

impl MulAssign for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn mul_assign(&mut self, other: Float<f32>)

Performs the *= operation. Read more
Source§

impl MulAssign for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn mul_assign(&mut self, other: Float<f64>)

Performs the *= operation. Read more
Source§

impl Neg for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Float<f32>

Performs the unary - operation. Read more
Source§

impl Neg for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Float<f64>

Performs the unary - operation. Read more
Source§

impl<T: PartialEq> PartialEq<T> for Float<T>

Source§

fn eq(&self, other: &T) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: PartialEq> PartialEq for Float<T>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: PartialOrd> PartialOrd<T> for Float<T>

Source§

fn partial_cmp(&self, other: &T) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T: PartialOrd> PartialOrd for Float<T>

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<'s, 'o> Rem<&'o Float<f32>> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the % operator.
Source§

fn rem(self, other: &'o Float<f32>) -> Float<f32>

Performs the % operation. Read more
Source§

impl<'o> Rem<&'o Float<f32>> for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the % operator.
Source§

fn rem(self, other: &'o Float<f32>) -> Float<f32>

Performs the % operation. Read more
Source§

impl<'s, 'o> Rem<&'o Float<f64>> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the % operator.
Source§

fn rem(self, other: &'o Float<f64>) -> Float<f64>

Performs the % operation. Read more
Source§

impl<'o> Rem<&'o Float<f64>> for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the % operator.
Source§

fn rem(self, other: &'o Float<f64>) -> Float<f64>

Performs the % operation. Read more
Source§

impl<'s, 'o> Rem<&'o f32> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the % operator.
Source§

fn rem(self, other: &'o f32) -> Float<f32>

Performs the % operation. Read more
Source§

impl<'o> Rem<&'o f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the % operator.
Source§

fn rem(self, other: &'o f32) -> Float<f32>

Performs the % operation. Read more
Source§

impl<'s, 'o> Rem<&'o f64> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the % operator.
Source§

fn rem(self, other: &'o f64) -> Float<f64>

Performs the % operation. Read more
Source§

impl<'o> Rem<&'o f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the % operator.
Source§

fn rem(self, other: &'o f64) -> Float<f64>

Performs the % operation. Read more
Source§

impl<'s> Rem<Float<f32>> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the % operator.
Source§

fn rem(self, other: Float<f32>) -> Float<f32>

Performs the % operation. Read more
Source§

impl<'s> Rem<Float<f64>> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the % operator.
Source§

fn rem(self, other: Float<f64>) -> Float<f64>

Performs the % operation. Read more
Source§

impl<'s> Rem<f32> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the % operator.
Source§

fn rem(self, other: f32) -> Float<f32>

Performs the % operation. Read more
Source§

impl Rem<f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the % operator.
Source§

fn rem(self, other: f32) -> Float<f32>

Performs the % operation. Read more
Source§

impl<'s> Rem<f64> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the % operator.
Source§

fn rem(self, other: f64) -> Float<f64>

Performs the % operation. Read more
Source§

impl Rem<f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the % operator.
Source§

fn rem(self, other: f64) -> Float<f64>

Performs the % operation. Read more
Source§

impl Rem for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the % operator.
Source§

fn rem(self, other: Float<f32>) -> Float<f32>

Performs the % operation. Read more
Source§

impl Rem for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the % operator.
Source§

fn rem(self, other: Float<f64>) -> Float<f64>

Performs the % operation. Read more
Source§

impl<'o> RemAssign<&'o Float<f32>> for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn rem_assign(&mut self, other: &'o Float<f32>)

Performs the %= operation. Read more
Source§

impl<'o> RemAssign<&'o Float<f64>> for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn rem_assign(&mut self, other: &'o Float<f64>)

Performs the %= operation. Read more
Source§

impl<'o> RemAssign<&'o f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn rem_assign(&mut self, other: &'o f32)

Performs the %= operation. Read more
Source§

impl<'o> RemAssign<&'o f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn rem_assign(&mut self, other: &'o f64)

Performs the %= operation. Read more
Source§

impl RemAssign<f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn rem_assign(&mut self, other: f32)

Performs the %= operation. Read more
Source§

impl RemAssign<f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn rem_assign(&mut self, other: f64)

Performs the %= operation. Read more
Source§

impl RemAssign for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn rem_assign(&mut self, other: Float<f32>)

Performs the %= operation. Read more
Source§

impl RemAssign for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn rem_assign(&mut self, other: Float<f64>)

Performs the %= operation. Read more
Source§

impl<'s, 'o> Sub<&'o Float<f32>> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'o Float<f32>) -> Float<f32>

Performs the - operation. Read more
Source§

impl<'o> Sub<&'o Float<f32>> for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'o Float<f32>) -> Float<f32>

Performs the - operation. Read more
Source§

impl<'s, 'o> Sub<&'o Float<f64>> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'o Float<f64>) -> Float<f64>

Performs the - operation. Read more
Source§

impl<'o> Sub<&'o Float<f64>> for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'o Float<f64>) -> Float<f64>

Performs the - operation. Read more
Source§

impl<'s, 'o> Sub<&'o f32> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'o f32) -> Float<f32>

Performs the - operation. Read more
Source§

impl<'o> Sub<&'o f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'o f32) -> Float<f32>

Performs the - operation. Read more
Source§

impl<'s, 'o> Sub<&'o f64> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'o f64) -> Float<f64>

Performs the - operation. Read more
Source§

impl<'o> Sub<&'o f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'o f64) -> Float<f64>

Performs the - operation. Read more
Source§

impl<'s> Sub<Float<f32>> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the - operator.
Source§

fn sub(self, other: Float<f32>) -> Float<f32>

Performs the - operation. Read more
Source§

impl<'s> Sub<Float<f64>> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the - operator.
Source§

fn sub(self, other: Float<f64>) -> Float<f64>

Performs the - operation. Read more
Source§

impl<'s> Sub<f32> for &'s Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the - operator.
Source§

fn sub(self, other: f32) -> Float<f32>

Performs the - operation. Read more
Source§

impl Sub<f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the - operator.
Source§

fn sub(self, other: f32) -> Float<f32>

Performs the - operation. Read more
Source§

impl<'s> Sub<f64> for &'s Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the - operator.
Source§

fn sub(self, other: f64) -> Float<f64>

Performs the - operation. Read more
Source§

impl Sub<f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the - operator.
Source§

fn sub(self, other: f64) -> Float<f64>

Performs the - operation. Read more
Source§

impl Sub for Float<f32>

Available on crate feature _float_f32 only.
Source§

type Output = Float<f32>

The resulting type after applying the - operator.
Source§

fn sub(self, other: Float<f32>) -> Float<f32>

Performs the - operation. Read more
Source§

impl Sub for Float<f64>

Available on crate feature _float_f64 only.
Source§

type Output = Float<f64>

The resulting type after applying the - operator.
Source§

fn sub(self, other: Float<f64>) -> Float<f64>

Performs the - operation. Read more
Source§

impl<'o> SubAssign<&'o Float<f32>> for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn sub_assign(&mut self, other: &'o Float<f32>)

Performs the -= operation. Read more
Source§

impl<'o> SubAssign<&'o Float<f64>> for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn sub_assign(&mut self, other: &'o Float<f64>)

Performs the -= operation. Read more
Source§

impl<'o> SubAssign<&'o f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn sub_assign(&mut self, other: &'o f32)

Performs the -= operation. Read more
Source§

impl<'o> SubAssign<&'o f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn sub_assign(&mut self, other: &'o f64)

Performs the -= operation. Read more
Source§

impl SubAssign<f32> for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn sub_assign(&mut self, other: f32)

Performs the -= operation. Read more
Source§

impl SubAssign<f64> for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn sub_assign(&mut self, other: f64)

Performs the -= operation. Read more
Source§

impl SubAssign for Float<f32>

Available on crate feature _float_f32 only.
Source§

fn sub_assign(&mut self, other: Float<f32>)

Performs the -= operation. Read more
Source§

impl SubAssign for Float<f64>

Available on crate feature _float_f64 only.
Source§

fn sub_assign(&mut self, other: Float<f64>)

Performs the -= operation. Read more
Source§

impl<T: Copy> Copy for Float<T>

Auto Trait Implementations§

§

impl<T> Freeze for Float<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Float<T>
where T: RefUnwindSafe,

§

impl<T> Send for Float<T>
where T: Send,

§

impl<T> Sync for Float<T>
where T: Sync,

§

impl<T> Unpin for Float<T>
where T: Unpin,

§

impl<T> UnwindSafe for Float<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ByteSized for T

Source§

const BYTE_ALIGN: usize = _

The alignment of this type in bytes.
Source§

const BYTE_SIZE: usize = _

The size of this type in bytes.
Source§

fn byte_align(&self) -> usize

Returns the alignment of this type in bytes.
Source§

fn byte_size(&self) -> usize

Returns the size of this type in bytes. Read more
Source§

fn ptr_size_ratio(&self) -> [usize; 2]

Returns the size ratio between Ptr::BYTES and BYTE_SIZE. Read more
Source§

impl<T, R> Chain<R> for T
where T: ?Sized,

Source§

fn chain<F>(self, f: F) -> R
where F: FnOnce(Self) -> R, Self: Sized,

Chain a function which takes the parameter by value.
Source§

fn chain_ref<F>(&self, f: F) -> R
where F: FnOnce(&Self) -> R,

Chain a function which takes the parameter by shared reference.
Source§

fn chain_mut<F>(&mut self, f: F) -> R
where F: FnOnce(&mut Self) -> R,

Chain a function which takes the parameter by exclusive reference.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> ExtAny for T
where T: Any + ?Sized,

Source§

fn type_id() -> TypeId

Returns the TypeId of Self. Read more
Source§

fn type_of(&self) -> TypeId

Returns the TypeId of self. Read more
Source§

fn type_name(&self) -> &'static str

Returns the type name of self. Read more
Source§

fn type_is<T: 'static>(&self) -> bool

Returns true if Self is of type T. Read more
Source§

fn as_any_ref(&self) -> &dyn Any
where Self: Sized,

Upcasts &self as &dyn Any. Read more
Source§

fn as_any_mut(&mut self) -> &mut dyn Any
where Self: Sized,

Upcasts &mut self as &mut dyn Any. Read more
Source§

fn as_any_box(self: Box<Self>) -> Box<dyn Any>
where Self: Sized,

Upcasts Box<self> as Box<dyn Any>. Read more
Source§

fn downcast_ref<T: 'static>(&self) -> Option<&T>

Available on crate feature unsafe_layout only.
Returns some shared reference to the inner value if it is of type T. Read more
Source§

fn downcast_mut<T: 'static>(&mut self) -> Option<&mut T>

Available on crate feature unsafe_layout only.
Returns some exclusive reference to the inner value if it is of type T. Read more
Source§

impl<T> ExtMem for T
where T: ?Sized,

Source§

const NEEDS_DROP: bool = _

Know whether dropping values of this type matters, in compile-time.
Source§

fn mem_align_of<T>() -> usize

Returns the minimum alignment of the type in bytes. Read more
Source§

fn mem_align_of_val(&self) -> usize

Returns the alignment of the pointed-to value in bytes. Read more
Source§

fn mem_size_of<T>() -> usize

Returns the size of a type in bytes. Read more
Source§

fn mem_size_of_val(&self) -> usize

Returns the size of the pointed-to value in bytes. Read more
Source§

fn mem_copy(&self) -> Self
where Self: Copy,

Bitwise-copies a value. Read more
Source§

fn mem_needs_drop(&self) -> bool

Returns true if dropping values of this type matters. Read more
Source§

fn mem_drop(self)
where Self: Sized,

Drops self by running its destructor. Read more
Source§

fn mem_forget(self)
where Self: Sized,

Forgets about self without running its destructor. Read more
Source§

fn mem_replace(&mut self, other: Self) -> Self
where Self: Sized,

Replaces self with other, returning the previous value of self. Read more
Source§

fn mem_take(&mut self) -> Self
where Self: Default,

Replaces self with its default value, returning the previous value of self. Read more
Source§

fn mem_swap(&mut self, other: &mut Self)
where Self: Sized,

Swaps the value of self and other without deinitializing either one. Read more
Source§

unsafe fn mem_zeroed<T>() -> T

Available on crate feature unsafe_layout only.
Returns the value of type T represented by the all-zero byte-pattern. Read more
Source§

unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst

Available on crate feature unsafe_layout only.
Returns the value of type T represented by the all-zero byte-pattern. Read more
Source§

fn mem_as_bytes(&self) -> &[u8]
where Self: Sync + Unpin,

Available on crate feature unsafe_slice only.
View a Sync + Unpin self as &[u8]. Read more
Source§

fn mem_as_bytes_mut(&mut self) -> &mut [u8]
where Self: Sync + Unpin,

Available on crate feature unsafe_slice only.
View a Sync + Unpin self as &mut [u8]. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

Source§

impl<T> Hook for T

Source§

fn hook_ref<F>(self, f: F) -> Self
where F: FnOnce(&Self),

Applies a function which takes the parameter by shared reference, and then returns the (possibly) modified owned value. Read more
Source§

fn hook_mut<F>(self, f: F) -> Self
where F: FnOnce(&mut Self),

Applies a function which takes the parameter by exclusive reference, and then returns the (possibly) modified owned value. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> LayoutRaw for T

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

§

impl<T> Ungil for T
where T: Send,