[][src]Trait compiler_builtins::float::Float

pub trait Float: Copy + PartialEq + PartialOrd + AddAssign + MulAssign + Add<Output = Self> + Sub<Output = Self> + Div<Output = Self> + Rem<Output = Self> {
    type Int: Int;
    type SignedInt: Int;

    const ZERO: Self;
    const ONE: Self;
    const BITS: u32;
    const SIGNIFICAND_BITS: u32;
    const EXPONENT_BITS: u32;
    const EXPONENT_MAX: u32;
    const EXPONENT_BIAS: u32;
    const SIGN_MASK: Self::Int;
    const SIGNIFICAND_MASK: Self::Int;
    const IMPLICIT_BIT: Self::Int;
    const EXPONENT_MASK: Self::Int;

    fn repr(self) -> Self::Int;
fn signed_repr(self) -> Self::SignedInt;
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); }
🔬 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: 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

type SignedInt: Int

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

A int of the same with as the float

Loading content...

Associated Constants

const ZERO: Self

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

const ONE: Self

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

const BITS: u32

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

The bitwidth of the float type

const SIGNIFICAND_BITS: u32

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

The bitwidth of the significand

const EXPONENT_BITS: u32

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

The bitwidth of the exponent

const EXPONENT_MAX: u32

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

The maximum value of the exponent

const EXPONENT_BIAS: u32

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

The exponent bias value

const SIGN_MASK: Self::Int

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

A mask for the sign bit

const SIGNIFICAND_MASK: Self::Int

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

A mask for the significand

const IMPLICIT_BIT: Self::Int

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

const EXPONENT_MASK: Self::Int

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

A mask for the exponent

Loading content...

Required methods

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 signed_repr(self) -> Self::SignedInt

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

Returns self transmuted to Self::SignedInt

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)

Loading content...

Implementors

impl Float for f32[src]

type Int = u32

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

type SignedInt = i32

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

const EXPONENT_BITS: u32[src]

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

const EXPONENT_MAX: u32[src]

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

const EXPONENT_BIAS: u32[src]

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

impl Float for f64[src]

type Int = u64

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

type SignedInt = i64

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

const EXPONENT_BITS: u32[src]

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

const EXPONENT_MAX: u32[src]

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

const EXPONENT_BIAS: u32[src]

🔬 This is a nightly-only experimental API. (compiler_builtins_lib)

Compiler builtins. Will never become stable.

Loading content...