Trait compiler_builtins::float::Float
[−]
[src]
pub trait Float: Sized + Copy {
type Int;
fn bits() -> u32;
fn significand_bits() -> u32;
fn sign_mask() -> Self::Int;
fn significand_mask() -> Self::Int;
fn exponent_mask() -> Self::Int;
fn repr(self) -> Self::Int;
fn from_repr(a: Self::Int) -> Self;
fn from_parts(sign: bool,
exponent: Self::Int,
significand: Self::Int)
-> Self;
fn normalize(significand: Self::Int) -> (i32, Self::Int);
fn exponent_bits() -> u32 { ... }
}🔬 This is a nightly-only experimental API. (compiler_builtins_lib)
Compiler builtins. Will never become stable.
Trait for some basic operations on floats
Associated Types
type Int
🔬 This is a nightly-only experimental API. (compiler_builtins_lib)
Compiler builtins. Will never become stable.
A uint of the same with as the float
Required Methods
fn bits() -> u32
🔬 This is a nightly-only experimental API. (compiler_builtins_lib)
Compiler builtins. Will never become stable.
Returns the bitwidth of the float type
fn significand_bits() -> u32
🔬 This is a nightly-only experimental API. (compiler_builtins_lib)
Compiler builtins. Will never become stable.
Returns the bitwidth of the significand
fn sign_mask() -> Self::Int
🔬 This is a nightly-only experimental API. (compiler_builtins_lib)
Compiler builtins. Will never become stable.
Returns a mask for the sign bit
fn significand_mask() -> Self::Int
🔬 This is a nightly-only experimental API. (compiler_builtins_lib)
Compiler builtins. Will never become stable.
Returns a mask for the significand
fn exponent_mask() -> Self::Int
🔬 This is a nightly-only experimental API. (compiler_builtins_lib)
Compiler builtins. Will never become stable.
Returns a mask for the exponent
fn repr(self) -> Self::Int
🔬 This is a nightly-only experimental API. (compiler_builtins_lib)
Compiler builtins. Will never become stable.
Returns self transmuted to Self::Int
fn from_repr(a: Self::Int) -> Self
🔬 This is a nightly-only experimental API. (compiler_builtins_lib)
Compiler builtins. Will never become stable.
Returns a Self::Int transmuted back to Self
fn from_parts(sign: bool, exponent: Self::Int, significand: Self::Int) -> Self
🔬 This is a nightly-only experimental API. (compiler_builtins_lib)
Compiler builtins. Will never become stable.
Constructs a Self from its parts. Inputs are treated as bits and shifted into position.
fn normalize(significand: Self::Int) -> (i32, Self::Int)
🔬 This is a nightly-only experimental API. (compiler_builtins_lib)
Compiler builtins. Will never become stable.
Returns (normalized exponent, normalized significand)
Provided Methods
fn exponent_bits() -> u32
🔬 This is a nightly-only experimental API. (compiler_builtins_lib)
Compiler builtins. Will never become stable.
Returns the bitwidth of the exponent
Implementors
impl Float for f32impl Float for f64