Trait SignedNumeric
trait SignedNumeric: Numeric
This trait extends many common signed integer types so that they can be used with the bitstream handling traits.
Required Methods
fn is_negative(self: Self) -> boolReturns true if this value is negative
fn as_negative(self: Self, bits: u32) -> SelfGiven a two-complement positive value and certain number of bits, returns this value as a negative number.
fn as_negative_fixed<BITS: u32>(self: Self) -> SelfGiven a two-complement positive value and certain number of bits, returns this value as a negative number.
fn as_unsigned(self: Self, bits: u32) -> SelfGiven a negative value and a certain number of bits, returns this value as a twos-complement positive number.
fn as_unsigned_fixed<BITS: u32>(self: Self) -> SelfGiven a negative value and a certain number of bits, returns this value as a twos-complement positive number.
fn signed_value(self: Self) -> SignedValueConverts to a generic signed value for stream recording purposes.
Implementors
impl SignedNumeric for i16impl SignedNumeric for i8impl SignedNumeric for i128impl SignedNumeric for i64impl SignedNumeric for i32