[−][src]Trait compiler_builtins::int::Int
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
Trait for some basic operations on integers
Associated Types
type OtherSign: Int
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
Type with the same width but other signedness
type UnsignedInt: Int
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
Unsigned version of Self
Associated Constants
const BITS: u32
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
The bitwidth of the int type
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.
Required methods
fn extract_sign(self) -> (bool, Self::UnsignedInt)
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
Extracts the sign from self and returns a tuple.
Examples
let i = -25_i32; let (sign, u) = i.extract_sign(); assert_eq!(sign, true); assert_eq!(u, 25_u32);Run
fn unsigned(self) -> Self::UnsignedInt
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
fn from_unsigned(unsigned: Self::UnsignedInt) -> Self
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
fn from_bool(b: bool) -> Self
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
fn max_value() -> Self
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
fn min_value() -> Self
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
fn wrapping_add(self, other: Self) -> Self
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
fn wrapping_mul(self, other: Self) -> Self
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
fn wrapping_sub(self, other: Self) -> Self
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
fn wrapping_shl(self, other: u32) -> Self
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
fn overflowing_add(self, other: Self) -> (Self, bool)
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
fn aborting_div(self, other: Self) -> Self
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
fn aborting_rem(self, other: Self) -> Self
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
fn leading_zeros(self) -> u32
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
Implementors
impl Int for i32
[src]
type OtherSign = u32
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
type UnsignedInt = u32
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
fn extract_sign(self) -> (bool, u32)
[src]
fn unsigned(self) -> u32
[src]
fn from_unsigned(me: u32) -> Self
[src]
const BITS: u32
[src]
const ZERO: Self
[src]
const ONE: Self
[src]
fn from_bool(b: bool) -> Self
[src]
fn max_value() -> Self
[src]
fn min_value() -> Self
[src]
fn wrapping_add(self, other: Self) -> Self
[src]
fn wrapping_mul(self, other: Self) -> Self
[src]
fn wrapping_sub(self, other: Self) -> Self
[src]
fn wrapping_shl(self, other: u32) -> Self
[src]
fn overflowing_add(self, other: Self) -> (Self, bool)
[src]
fn aborting_div(self, other: Self) -> Self
[src]
fn aborting_rem(self, other: Self) -> Self
[src]
fn leading_zeros(self) -> u32
[src]
impl Int for i64
[src]
type OtherSign = u64
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
type UnsignedInt = u64
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
fn extract_sign(self) -> (bool, u64)
[src]
fn unsigned(self) -> u64
[src]
fn from_unsigned(me: u64) -> Self
[src]
const BITS: u32
[src]
const ZERO: Self
[src]
const ONE: Self
[src]
fn from_bool(b: bool) -> Self
[src]
fn max_value() -> Self
[src]
fn min_value() -> Self
[src]
fn wrapping_add(self, other: Self) -> Self
[src]
fn wrapping_mul(self, other: Self) -> Self
[src]
fn wrapping_sub(self, other: Self) -> Self
[src]
fn wrapping_shl(self, other: u32) -> Self
[src]
fn overflowing_add(self, other: Self) -> (Self, bool)
[src]
fn aborting_div(self, other: Self) -> Self
[src]
fn aborting_rem(self, other: Self) -> Self
[src]
fn leading_zeros(self) -> u32
[src]
impl Int for i128
[src]
type OtherSign = u128
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
type UnsignedInt = u128
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
fn extract_sign(self) -> (bool, u128)
[src]
fn unsigned(self) -> u128
[src]
fn from_unsigned(me: u128) -> Self
[src]
const BITS: u32
[src]
const ZERO: Self
[src]
const ONE: Self
[src]
fn from_bool(b: bool) -> Self
[src]
fn max_value() -> Self
[src]
fn min_value() -> Self
[src]
fn wrapping_add(self, other: Self) -> Self
[src]
fn wrapping_mul(self, other: Self) -> Self
[src]
fn wrapping_sub(self, other: Self) -> Self
[src]
fn wrapping_shl(self, other: u32) -> Self
[src]
fn overflowing_add(self, other: Self) -> (Self, bool)
[src]
fn aborting_div(self, other: Self) -> Self
[src]
fn aborting_rem(self, other: Self) -> Self
[src]
fn leading_zeros(self) -> u32
[src]
impl Int for u32
[src]
type OtherSign = i32
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
type UnsignedInt = u32
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
fn extract_sign(self) -> (bool, u32)
[src]
fn unsigned(self) -> u32
[src]
fn from_unsigned(me: u32) -> Self
[src]
const BITS: u32
[src]
const ZERO: Self
[src]
const ONE: Self
[src]
fn from_bool(b: bool) -> Self
[src]
fn max_value() -> Self
[src]
fn min_value() -> Self
[src]
fn wrapping_add(self, other: Self) -> Self
[src]
fn wrapping_mul(self, other: Self) -> Self
[src]
fn wrapping_sub(self, other: Self) -> Self
[src]
fn wrapping_shl(self, other: u32) -> Self
[src]
fn overflowing_add(self, other: Self) -> (Self, bool)
[src]
fn aborting_div(self, other: Self) -> Self
[src]
fn aborting_rem(self, other: Self) -> Self
[src]
fn leading_zeros(self) -> u32
[src]
impl Int for u64
[src]
type OtherSign = i64
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
type UnsignedInt = u64
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
fn extract_sign(self) -> (bool, u64)
[src]
fn unsigned(self) -> u64
[src]
fn from_unsigned(me: u64) -> Self
[src]
const BITS: u32
[src]
const ZERO: Self
[src]
const ONE: Self
[src]
fn from_bool(b: bool) -> Self
[src]
fn max_value() -> Self
[src]
fn min_value() -> Self
[src]
fn wrapping_add(self, other: Self) -> Self
[src]
fn wrapping_mul(self, other: Self) -> Self
[src]
fn wrapping_sub(self, other: Self) -> Self
[src]
fn wrapping_shl(self, other: u32) -> Self
[src]
fn overflowing_add(self, other: Self) -> (Self, bool)
[src]
fn aborting_div(self, other: Self) -> Self
[src]
fn aborting_rem(self, other: Self) -> Self
[src]
fn leading_zeros(self) -> u32
[src]
impl Int for u128
[src]
type OtherSign = i128
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.
type UnsignedInt = u128
🔬 This is a nightly-only experimental API. (compiler_builtins_lib
)
Compiler builtins. Will never become stable.