Sha256: 6040bdd49c03f11f8607b2da1703e1b7b5f57ddac9b02322c6958f9c1684496f

Contents?: true

Size: 633 Bytes

Versions: 36

Compression:

Stored size: 633 Bytes

Contents

// FLOAT TYPE

#![doc(hidden)]

use crate::num::Float;

/// Extended precision floating-point type.
///
/// Private implementation, exposed only for testing purposes.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct ExtendedFloat {
    /// Mantissa for the extended-precision float.
    pub mant: u64,
    /// Binary exponent for the extended-precision float.
    pub exp: i32,
}

/// Converts an `ExtendedFloat` to the closest machine float type.
#[inline(always)]
pub fn extended_to_float<F: Float>(x: ExtendedFloat) -> F {
    let mut word = x.mant;
    word |= (x.exp as u64) << F::MANTISSA_SIZE;
    F::from_bits(word)
}

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
wasmtime-27.0.0 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs
wasmtime-26.0.0 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs
wasmtime-25.0.2 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs
wasmtime-25.0.1 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs
wasmtime-25.0.0 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs
wasmtime-24.0.0 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs
wasmtime-23.0.2 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs
wasmtime-22.0.0 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs
wasmtime-21.0.1 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs
wasmtime-20.0.2 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs
wasmtime-20.0.0 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs
wasmtime-18.0.3 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs
wasmtime-17.0.1 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs
wasmtime-17.0.0 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs
wasmtime-16.0.0 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs
wasmtime-15.0.1 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs
wasmtime-15.0.0 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs
wasmtime-14.0.4 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs
wasmtime-14.0.3 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs
wasmtime-14.0.1 ./ext/cargo-vendor/minimal-lexical-0.2.1/src/extended_float.rs