[−][src]Trait compiler_builtins::float::Float
Trait for some basic operations on floats
Associated Types
type Int: Int
A uint of the same with as the float
type SignedInt: Int
A int of the same with as the float
Associated Constants
const ZERO: Self
const ONE: Self
const BITS: u32
The bitwidth of the float type
const SIGNIFICAND_BITS: u32
The bitwidth of the significand
const EXPONENT_BITS: u32
The bitwidth of the exponent
const EXPONENT_MAX: u32
The maximum value of the exponent
const EXPONENT_BIAS: u32
The exponent bias value
const SIGN_MASK: Self::Int
A mask for the sign bit
const SIGNIFICAND_MASK: Self::Int
A mask for the significand
const IMPLICIT_BIT: Self::Int
const EXPONENT_MASK: Self::Int
A mask for the exponent
Required methods
fn repr(self) -> Self::Int
Returns self
transmuted to Self::Int
fn signed_repr(self) -> Self::SignedInt
Returns self
transmuted to Self::SignedInt
fn from_repr(a: Self::Int) -> Self
Returns a Self::Int
transmuted back to Self
fn from_parts(sign: bool, exponent: Self::Int, significand: Self::Int) -> Self
Constructs a Self
from its parts. Inputs are treated as bits and shifted into position.
fn normalize(significand: Self::Int) -> (i32, Self::Int)
Returns (normalized exponent, normalized significand)