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) -> bool

Returns true if this value is negative

fn as_negative(self: Self, bits: u32) -> Self

Given 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) -> Self

Given a two-complement positive value and certain number of bits, returns this value as a negative number.

fn as_unsigned(self: Self, bits: u32) -> Self

Given 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) -> Self

Given a negative value and a certain number of bits, returns this value as a twos-complement positive number.

fn signed_value(self: Self) -> SignedValue

Converts to a generic signed value for stream recording purposes.

Implementors