Struct eos_rs::api::fixed::FixedI16

source ·
#[repr(transparent)]
pub struct FixedI16<Frac> { /* private fields */ }
Expand description

A 16-bit signed number with Frac fractional bits.

The number has 16 bits, of which f = Frac are fractional bits and 16 − f are integer bits. The value x can lie in the range −215/2f ≤ x < 215/2f. The difference between successive numbers is constant throughout the range: Δ = 1/2f.

For FixedI16<U0>, f = 0 and Δ = 1, and the fixed-point number behaves like an [i16] with the value lying in the range −215 ≤ x < 215. For FixedI16<U16>, f = 16 and Δ = 1/216, and the value lies in the range −1/2 ≤ x < 1/2.

Frac is an Unsigned as provided by the typenum crate; the plan is to to have a major version 2 where Frac is replaced by FRAC of type [i32] when the Rust compiler’s generic_const_exprs feature is ready and stabilized. An alpha version is already available.

FixedI16<Frac> has the same size, alignment and ABI as [i16]; it is #[repr(transparent)] with [i16] as the only non-zero-sized field.

Examples

use fixed::{types::extra::U3, FixedI16};
let eleven = FixedI16::<U3>::from_num(11);
assert_eq!(eleven, FixedI16::<U3>::from_bits(11 << 3));
assert_eq!(eleven, 11);
assert_eq!(eleven.to_string(), "11");
let two_point_75 = eleven / 4;
assert_eq!(two_point_75, FixedI16::<U3>::from_bits(11 << 1));
assert_eq!(two_point_75, 2.75);
assert_eq!(two_point_75.to_string(), "2.8");

Implementations§

source§

impl<Frac> FixedI16<Frac>

The implementation of items in this block is independent of the number of fractional bits Frac.

source

pub const ZERO: FixedI16<Frac> = Self::from_bits(0)

Zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::ZERO, Fix::from_bits(0));
source

pub const DELTA: FixedI16<Frac> = Self::from_bits(1)

The difference between any two successive representable numbers, Δ.

If the number has f = Frac fractional bits, then Δ = 1/2f.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::DELTA, Fix::from_bits(1));
// binary 0.0001 is decimal 0.0625
assert_eq!(Fix::DELTA, 0.0625);
source

pub const MIN: FixedI16<Frac> = Self::from_bits(i16::MIN)

The smallest value that can be represented.

If the number has f = Frac fractional bits, then the minimum is −215/2f.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::MIN, Fix::from_bits(i16::MIN));
source

pub const MAX: FixedI16<Frac> = Self::from_bits(i16::MAX)

The largest value that can be represented.

If the number has f = Frac fractional bits, then the maximum is (215 − 1)/2f.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::MAX, Fix::from_bits(i16::MAX));
source

pub const IS_SIGNED: bool = true

[true][bool] because the FixedI16 type is signed.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert!(Fix::IS_SIGNED);
source

pub const fn from_bits(bits: i16) -> FixedI16<Frac>

Creates a fixed-point number that has a bitwise representation identical to the given integer.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
// 0010.0000 = 2
assert_eq!(Fix::from_bits(0b10_0000), 2);
source

pub const fn to_bits(self) -> i16

Creates an integer that has a bitwise representation identical to the given fixed-point number.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
// 2 is 0010.0000
assert_eq!(Fix::from_num(2).to_bits(), 0b10_0000);
source

pub const fn from_be(f: FixedI16<Frac>) -> FixedI16<Frac>

Converts a fixed-point number from big endian to the target’s endianness.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let f = Fix::from_bits(0x1234);
if cfg!(target_endian = "big") {
    assert_eq!(Fix::from_be(f), f);
} else {
    assert_eq!(Fix::from_be(f), f.swap_bytes());
}
source

pub const fn from_le(f: FixedI16<Frac>) -> FixedI16<Frac>

Converts a fixed-point number from little endian to the target’s endianness.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let f = Fix::from_bits(0x1234);
if cfg!(target_endian = "little") {
    assert_eq!(Fix::from_le(f), f);
} else {
    assert_eq!(Fix::from_le(f), f.swap_bytes());
}
source

pub const fn to_be(self) -> FixedI16<Frac>

Converts self to big endian from the target’s endianness.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let f = Fix::from_bits(0x1234);
if cfg!(target_endian = "big") {
    assert_eq!(f.to_be(), f);
} else {
    assert_eq!(f.to_be(), f.swap_bytes());
}
source

pub const fn to_le(self) -> FixedI16<Frac>

Converts self to little endian from the target’s endianness.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let f = Fix::from_bits(0x1234);
if cfg!(target_endian = "little") {
    assert_eq!(f.to_le(), f);
} else {
    assert_eq!(f.to_le(), f.swap_bytes());
}
source

pub const fn swap_bytes(self) -> FixedI16<Frac>

Reverses the byte order of the fixed-point number.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let f = Fix::from_bits(0x1234);
let swapped = Fix::from_bits(0x3412);
assert_eq!(f.swap_bytes(), swapped);
source

pub const fn from_be_bytes(bytes: [u8; 2]) -> FixedI16<Frac>

Creates a fixed-point number from its representation as a byte array in big endian.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::from_be_bytes([0x12, 0x34]),
    Fix::from_bits(0x1234)
);
source

pub const fn from_le_bytes(bytes: [u8; 2]) -> FixedI16<Frac>

Creates a fixed-point number from its representation as a byte array in little endian.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::from_le_bytes([0x34, 0x12]),
    Fix::from_bits(0x1234)
);
source

pub const fn from_ne_bytes(bytes: [u8; 2]) -> FixedI16<Frac>

Creates a fixed-point number from its representation as a byte array in native endian.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    if cfg!(target_endian = "big") {
        Fix::from_ne_bytes([0x12, 0x34])
    } else {
        Fix::from_ne_bytes([0x34, 0x12])
    },
    Fix::from_bits(0x1234)
);
source

pub const fn to_be_bytes(self) -> [u8; 2]

Returns the memory representation of this fixed-point number as a byte array in big-endian byte order.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let val = Fix::from_bits(0x1234);
assert_eq!(
    val.to_be_bytes(),
    [0x12, 0x34]
);
source

pub const fn to_le_bytes(self) -> [u8; 2]

Returns the memory representation of this fixed-point number as a byte array in little-endian byte order.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let val = Fix::from_bits(0x1234);
assert_eq!(
    val.to_le_bytes(),
    [0x34, 0x12]
);
source

pub const fn to_ne_bytes(self) -> [u8; 2]

Returns the memory representation of this fixed-point number as a byte array in native byte order.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let val = Fix::from_bits(0x1234);
assert_eq!(
    val.to_ne_bytes(),
    if cfg!(target_endian = "big") {
        [0x12, 0x34]
    } else {
        [0x34, 0x12]
    }
);
source

pub const fn count_ones(self) -> u32

Returns the number of ones in the binary representation.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let f = Fix::from_bits(0b11_0010);
assert_eq!(f.count_ones(), 3);
source

pub const fn count_zeros(self) -> u32

Returns the number of zeros in the binary representation.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let f = Fix::from_bits(!0b11_0010);
assert_eq!(f.count_zeros(), 3);
source

pub const fn leading_ones(self) -> u32

Returns the number of leading ones in the binary representation.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let all_ones = !Fix::ZERO;
let f = all_ones - Fix::from_bits(0b10_0000);
assert_eq!(f.leading_ones(), 16 - 6);
source

pub const fn leading_zeros(self) -> u32

Returns the number of leading zeros in the binary representation.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let f = Fix::from_bits(0b10_0000);
assert_eq!(f.leading_zeros(), 16 - 6);
source

pub const fn trailing_ones(self) -> u32

Returns the number of trailing ones in the binary representation.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let f = Fix::from_bits(0b101_1111);
assert_eq!(f.trailing_ones(), 5);
source

pub const fn trailing_zeros(self) -> u32

Returns the number of trailing zeros in the binary representation.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let f = Fix::from_bits(0b10_0000);
assert_eq!(f.trailing_zeros(), 5);
source

pub const fn signed_bits(self) -> u32

Returns the number of bits required to represent the value.

The number of bits required includes an initial one for negative numbers, and an initial zero for non-negative numbers.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(-3).signed_bits(), 7);      // “_101.0000”
assert_eq!(Fix::from_num(-1).signed_bits(), 5);      // “___1.0000”
assert_eq!(Fix::from_num(-0.0625).signed_bits(), 1); // “____.___1”
assert_eq!(Fix::from_num(0).signed_bits(), 1);       // “____.___0”
assert_eq!(Fix::from_num(0.0625).signed_bits(), 2);  // “____.__01”
assert_eq!(Fix::from_num(1).signed_bits(), 6);       // “__01.0000”
assert_eq!(Fix::from_num(3).signed_bits(), 7);       // “_011.0000”
source

pub const fn reverse_bits(self) -> FixedI16<Frac>

Reverses the order of the bits of the fixed-point number.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let bits = 0x1234_i16;
let rev_bits = bits.reverse_bits();
assert_eq!(Fix::from_bits(bits).reverse_bits(), Fix::from_bits(rev_bits));
source

pub const fn rotate_left(self, n: u32) -> FixedI16<Frac>

Shifts to the left by n bits, wrapping the truncated bits to the right end.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let bits: i16 = (0b111 << (16 - 3)) | 0b1010;
let rot = 0b1010111;
assert_eq!(bits.rotate_left(3), rot);
assert_eq!(Fix::from_bits(bits).rotate_left(3), Fix::from_bits(rot));
source

pub const fn rotate_right(self, n: u32) -> FixedI16<Frac>

Shifts to the right by n bits, wrapping the truncated bits to the left end.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let bits: i16 = 0b1010111;
let rot = (0b111 << (16 - 3)) | 0b1010;
assert_eq!(bits.rotate_right(3), rot);
assert_eq!(Fix::from_bits(bits).rotate_right(3), Fix::from_bits(rot));
source

pub const fn is_zero(self) -> bool

Returns [true] if the number is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert!(Fix::ZERO.is_zero());
assert!(!Fix::from_num(5).is_zero());
source

pub const fn is_positive(self) -> bool

Returns [true] if the number is > 0.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert!(Fix::from_num(5).is_positive());
assert!(!Fix::ZERO.is_positive());
assert!(!Fix::from_num(-5).is_positive());
source

pub const fn is_negative(self) -> bool

Returns [true] if the number is < 0.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert!(!Fix::from_num(5).is_negative());
assert!(!Fix::ZERO.is_negative());
assert!(Fix::from_num(-5).is_negative());
source

pub const fn wide_mul<RhsFrac>( self, rhs: FixedI16<RhsFrac> ) -> FixedI32<<Frac as Add<RhsFrac>>::Output>where Frac: Add<RhsFrac>,

Multiplies two fixed-point numbers and returns a wider type to retain all precision.

If self has f fractional bits and 16 − f integer bits, and rhs has g fractional bits and 16 − g integer bits, then the returned fixed-point number will have f + g fractional bits and 32 − f − g integer bits.

Examples
use fixed::{
    types::extra::{U2, U4},
    FixedI16,
};
// decimal: 1.25 × 1.0625 = 1.328_125
// binary: 1.01 × 1.0001 = 1.010101
let a = FixedI16::<U2>::from_num(1.25);
let b = FixedI16::<U4>::from_num(1.0625);
assert_eq!(a.wide_mul(b), 1.328_125);
source

pub const fn wide_mul_unsigned<RhsFrac>( self, rhs: FixedU16<RhsFrac> ) -> FixedI32<<Frac as Add<RhsFrac>>::Output>where Frac: Add<RhsFrac>,

Multiplies an unsigned fixed-point number and returns a wider signed type to retain all precision.

If self has f fractional bits and 16 − f integer bits, and rhs has g fractional bits and 16 − g integer bits, then the returned fixed-point number will have f + g fractional bits and 32 − f − g integer bits.

Examples
use fixed::{
    types::extra::{U2, U4},
    FixedI16, FixedU16,
};
// decimal: -1.25 × 1.0625 = -1.328_125
// binary: -1.01 × 1.0001 = -1.010101
let a = FixedI16::<U2>::from_num(-1.25);
let b = FixedU16::<U4>::from_num(1.0625);
assert_eq!(a.wide_mul_unsigned(b), -1.328_125);
source

pub const fn wide_div<RhsFrac>( self, rhs: FixedI16<RhsFrac> ) -> FixedI32<<<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0> as Add<Frac>>::Output as Sub<RhsFrac>>::Output>where UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>: Add<Frac>, <UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0> as Add<Frac>>::Output: Sub<RhsFrac>,

Divides two fixed-point numbers and returns a wider type to retain more precision.

If self has f fractional bits and 16 − f integer bits, and rhs has g fractional bits and 16 − g integer bits, then the returned fixed-point number will have 16 + f − g fractional bits and 16 − f + g integer bits.

Warning: While most cases of overflow are avoided using this method, dividing MIN by -DELTA will still result in panic due to overflow. The alternative wide_sdiv method avoids this by sacrificing one fractional bit in the return type.

Panics

Panics if the divisor is zero or on overflow. Overflow can only occur when dividing MIN by -DELTA.

Examples
use fixed::{
    types::extra::{U3, U5, U14},
    FixedI16, FixedI32,
};
// decimal: 4.625 / 0.03125 = 148
// binary: 100.101 / 0.00001 = 10010100
let a = FixedI16::<U3>::from_num(4.625);
let b = FixedI16::<U5>::from_num(0.03125);
let ans: FixedI32<U14> = a.wide_div(b);
assert_eq!(ans, 148);

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::MIN.wide_div(-Fix::DELTA);
source

pub const fn wide_sdiv<RhsFrac>( self, rhs: FixedI16<RhsFrac> ) -> FixedI32<<<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1> as Add<Frac>>::Output as Sub<RhsFrac>>::Output>where UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>: Add<Frac>, <UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1> as Add<Frac>>::Output: Sub<RhsFrac>,

Divides two fixed-point numbers and returns a wider type to retain more precision.

If self has f fractional bits and 16 − f integer bits, and rhs has g fractional bits and 16 − g integer bits, then the returned fixed-point number will have 15 + f − g fractional bits and 17 − f + g integer bits.

This is similar to the wide_div method but sacrifices one fractional bit to avoid overflow.

Panics

Panics if the divisor is zero.

Examples
use fixed::{
    types::extra::{U4, U5, U14},
    FixedI16, FixedI32,
};
// decimal: 4.625 / 0.03125 = 148
// binary: 100.101 / 0.00001 = 10010100
let a = FixedI16::<U4>::from_num(4.625);
let b = FixedI16::<U5>::from_num(0.03125);
let ans: FixedI32<U14> = a.wide_sdiv(b);
assert_eq!(ans, 148);

Unlike wide_div, dividing MIN by -DELTA does not overflow.

use fixed::{
    types::extra::{U4, U15},
    FixedI16, FixedI32,
};
type Fix = FixedI16<U4>;
type DFix = FixedI32<U15>;
assert_eq!(Fix::MIN.wide_sdiv(-Fix::DELTA), (DFix::MIN / 2).abs());
source

pub const fn wide_div_unsigned<RhsFrac>( self, rhs: FixedU16<RhsFrac> ) -> FixedI32<<<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0> as Add<Frac>>::Output as Sub<RhsFrac>>::Output>where UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>: Add<Frac>, <UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0> as Add<Frac>>::Output: Sub<RhsFrac>,

Divides by an unsigned fixed-point number and returns a wider signed type to retain more precision.

If self has f fractional bits and 16 − f integer bits, and rhs has g fractional bits and 16 − g integer bits, then the returned fixed-point number will have 16 + f − g fractional bits and 16 − f + g integer bits.

Panics

Panics if the divisor is zero.

Examples
use fixed::{
    types::extra::{U3, U5, U14},
    FixedI16, FixedI32, FixedU16,
};
// decimal: -4.625 / 0.03125 = -148
// binary: -100.101 / 0.00001 = -10010100
let a = FixedI16::<U3>::from_num(-4.625);
let b = FixedU16::<U5>::from_num(0.03125);
let ans: FixedI32<U14> = a.wide_div_unsigned(b);
assert_eq!(ans, -148);
source

pub const fn mul_add<MulFrac>( self, mul: FixedI16<MulFrac>, add: FixedI16<Frac> ) -> FixedI16<Frac>where MulFrac: LeEqU16,

Multiply and add. Returns self × mul + add.

For some cases, the product self × mul would overflow on its own, but the final result self × mul + add is representable; in these cases this method returns the correct result without overflow.

The mul parameter can have a fixed-point type like self but with a different number of fractional bits.

Panics

When debug assertions are enabled, this method panics if the result overflows. When debug assertions are not enabled, the wrapped value can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_mul_add instead.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::from_num(4).mul_add(Fix::from_num(0.5), Fix::from_num(3)),
    Fix::from_num(5)
);
// MAX × 1.5 - MAX = MAX / 2, which does not overflow
assert_eq!(Fix::MAX.mul_add(Fix::from_num(1.5), -Fix::MAX), Fix::MAX / 2);
source

pub const fn rem_euclid(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Remainder for Euclidean division.

Panics

Panics if the divisor is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(7.5).rem_euclid(Fix::from_num(2)), Fix::from_num(1.5));
assert_eq!(Fix::from_num(-7.5).rem_euclid(Fix::from_num(2)), Fix::from_num(0.5));
source

pub const fn abs(self) -> FixedI16<Frac>

Returns the absolute value.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let five = Fix::from_num(5);
let minus_five = Fix::from_num(-5);
assert_eq!(five.abs(), five);
assert_eq!(minus_five.abs(), five);
source

pub const fn unsigned_abs(self) -> FixedU16<Frac>

Returns the absolute value using an unsigned type without any wrapping or panicking.

Examples
use fixed::{types::extra::U4, FixedI16, FixedU16};
type Fix = FixedI16<U4>;
type UFix = FixedU16<U4>;
assert_eq!(Fix::from_num(-5).unsigned_abs(), UFix::from_num(5));
// min_as_unsigned has only highest bit set
let min_as_unsigned = UFix::ONE << (UFix::INT_NBITS - 1);
assert_eq!(Fix::MIN.unsigned_abs(), min_as_unsigned);
source

pub const fn dist(self, other: FixedI16<Frac>) -> FixedI16<Frac>

Returns the distance from self to other.

The distance is the absolute value of the difference.

Panics

When debug assertions are enabled, this method panics if the result overflows. When debug assertions are not enabled, the wrapped value can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_dist instead.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::ONE.dist(Fix::from_num(5)), Fix::from_num(4));
assert_eq!(Fix::NEG_ONE.dist(Fix::from_num(2)), Fix::from_num(3));
source

pub const fn unsigned_dist(self, other: FixedI16<Frac>) -> FixedU16<Frac>

Returns the distance from self to other using an unsigned type without any wrapping or panicking.

The distance is the absolute value of the difference.

Examples
use fixed::{types::extra::U4, FixedI16, FixedU16};
type Fix = FixedI16<U4>;
type UFix = FixedU16<U4>;
assert_eq!(Fix::NEG_ONE.unsigned_dist(Fix::from_num(2)), UFix::from_num(3));
assert_eq!(Fix::MIN.unsigned_dist(Fix::MAX), UFix::MAX);
source

pub const fn abs_diff(self, other: FixedI16<Frac>) -> FixedU16<Frac>

Returns the absolute value of the difference between self and other using an unsigned type without any wrapping or panicking.

This method is the same as unsigned_dist for signed fixed-point numbers.

source

pub const fn mean(self, other: FixedI16<Frac>) -> FixedI16<Frac>

Returns the mean of self and other.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(3).mean(Fix::from_num(4)), Fix::from_num(3.5));
assert_eq!(Fix::from_num(-3).mean(Fix::from_num(4)), Fix::from_num(0.5));
source

pub const fn next_multiple_of(self, other: FixedI16<Frac>) -> FixedI16<Frac>

Returns the smallest multiple of other that is ≥ self if other is positive, and the largest multiple of other that is ≤ self if other is negative.

Panics

Panics if other is zero.

When debug assertions are enabled, this method also panics if the result overflows. When debug assertions are not enabled, the wrapped value can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_next_multiple_of instead.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::from_num(4).next_multiple_of(Fix::from_num(1.5)),
    Fix::from_num(4.5)
);
assert_eq!(
    Fix::from_num(4).next_multiple_of(Fix::from_num(-1.5)),
    Fix::from_num(3)
);
source

pub const fn inv_lerp<RetFrac>( self, start: FixedI16<Frac>, end: FixedI16<Frac> ) -> FixedI16<RetFrac>where RetFrac: LeEqU16,

Inverse linear interpolation between start and end.

The computed value can have a fixed-point type like self but with a different number of fractional bits.

Returns (self − start) / (end − start). This is 0 when self = start, and 1 when self = end.

Panics

Panics when start = end.

When debug assertions are enabled, this method also panics if the result overflows. When debug assertions are not enabled, the wrapped value can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_inv_lerp instead.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let start = Fix::from_num(2);
let end = Fix::from_num(3.5);
assert_eq!(Fix::from_num(0.5).inv_lerp::<U4>(start, end), -1);
assert_eq!(Fix::from_num(2).inv_lerp::<U4>(start, end), 0);
assert_eq!(Fix::from_num(2.75).inv_lerp::<U4>(start, end), 0.5);
assert_eq!(Fix::from_num(3.5).inv_lerp::<U4>(start, end), 1);
assert_eq!(Fix::from_num(5).inv_lerp::<U4>(start, end), 2);
source

pub const fn add_unsigned(self, rhs: FixedU16<Frac>) -> FixedI16<Frac>

Addition with an unsigned fixed-point number.

Panics

When debug assertions are enabled, this method panics if the result overflows. When debug assertions are not enabled, the wrapped value can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_add_unsigned instead.

Examples
use fixed::{types::extra::U4, FixedI16, FixedU16};
type Fix = FixedI16<U4>;
type UFix = FixedU16<U4>;
assert_eq!(Fix::from_num(-5).add_unsigned(UFix::from_num(3)), -2);
source

pub const fn sub_unsigned(self, rhs: FixedU16<Frac>) -> FixedI16<Frac>

Subtraction with an unsigned fixed-point number.

Panics

When debug assertions are enabled, this method panics if the result overflows. When debug assertions are not enabled, the wrapped value can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_sub_unsigned instead.

Examples
use fixed::{types::extra::U4, FixedI16, FixedU16};
type Fix = FixedI16<U4>;
type UFix = FixedU16<U4>;
assert_eq!(Fix::from_num(3).sub_unsigned(UFix::from_num(5)), -2);
source

pub const fn const_not(self) -> FixedI16<Frac>

Bitwise NOT. Usable in constant context.

This is equivalent to the ! operator and [Not][core::ops::Not]::[not][core::ops::Not::not], but can also be used in constant context. Unless required in constant context, use the operator or trait instead.

Planned deprecation

This method will be deprecated when the ! operator and the [Not][core::ops::Not] trait are usable in constant context.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
const A: Fix = Fix::from_bits(0x3E);
const NOT_A: Fix = A.const_not();
assert_eq!(NOT_A, !A);
source

pub const fn const_bitand(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Bitwise AND. Usable in constant context.

This is equivalent to the & operator and [BitAnd][core::ops::BitAnd]::[bitand][core::ops::BitAnd::bitand], but can also be used in constant context. Unless required in constant context, use the operator or trait instead.

Planned deprecation

This method will be deprecated when the & operator and the [BitAnd][core::ops::BitAnd] trait are usable in constant context.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
const A: Fix = Fix::from_bits(0x3E);
const B: Fix = Fix::from_bits(0x55);
const A_BITAND_B: Fix = A.const_bitand(B);
assert_eq!(A_BITAND_B, A & B);
source

pub const fn const_bitor(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Bitwise OR. Usable in constant context.

This is equivalent to the | operator and [BitOr][core::ops::BitOr]::[bitor][core::ops::BitOr::bitor], but can also be used in constant context. Unless required in constant context, use the operator or trait instead.

Planned deprecation

This method will be deprecated when the | operator and the [BitOr][core::ops::BitOr] trait are usable in constant context.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
const A: Fix = Fix::from_bits(0x3E);
const B: Fix = Fix::from_bits(0x55);
const A_BITOR_B: Fix = A.const_bitor(B);
assert_eq!(A_BITOR_B, A | B);
source

pub const fn const_bitxor(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Bitwise XOR. Usable in constant context.

This is equivalent to the ^ operator and [BitXor][core::ops::BitXor]::[bitxor][core::ops::BitXor::bitxor], but can also be used in constant context. Unless required in constant context, use the operator or trait instead.

Planned deprecation

This method will be deprecated when the ^ operator and the [BitXor][core::ops::BitXor] trait are usable in constant context.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
const A: Fix = Fix::from_bits(0x3E);
const B: Fix = Fix::from_bits(0x55);
const A_BITXOR_B: Fix = A.const_bitxor(B);
assert_eq!(A_BITXOR_B, A ^ B);
source

pub const fn checked_neg(self) -> Option<FixedI16<Frac>>

Checked negation. Returns the negated value, or [None] on overflow.

Overflow can only occur when negating the minimum value.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(5).checked_neg(), Some(Fix::from_num(-5)));
assert_eq!(Fix::MIN.checked_neg(), None);
source

pub const fn checked_add(self, rhs: FixedI16<Frac>) -> Option<FixedI16<Frac>>

Checked addition. Returns the sum, or [None] on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!((Fix::MAX - Fix::ONE).checked_add(Fix::ONE), Some(Fix::MAX));
assert_eq!(Fix::MAX.checked_add(Fix::ONE), None);
source

pub const fn checked_sub(self, rhs: FixedI16<Frac>) -> Option<FixedI16<Frac>>

Checked subtraction. Returns the difference, or [None] on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!((Fix::MIN + Fix::ONE).checked_sub(Fix::ONE), Some(Fix::MIN));
assert_eq!(Fix::MIN.checked_sub(Fix::ONE), None);
source

pub const fn checked_rem(self, rhs: FixedI16<Frac>) -> Option<FixedI16<Frac>>

Checked remainder. Returns the remainder, or [None] if the divisor is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(1.5).checked_rem(Fix::ONE), Some(Fix::from_num(0.5)));
assert_eq!(Fix::from_num(1.5).checked_rem(Fix::ZERO), None);
source

pub const fn checked_mul_add<MulFrac>( self, mul: FixedI16<MulFrac>, add: FixedI16<Frac> ) -> Option<FixedI16<Frac>>where MulFrac: LeEqU16,

Checked multiply and add. Returns self × mul + add, or [None] on overflow.

For some cases, the product self × mul would overflow on its own, but the final result self × mul + add is representable; in these cases this method returns the correct result without overflow.

The mul parameter can have a fixed-point type like self but with a different number of fractional bits.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::from_num(4).checked_mul_add(Fix::from_num(0.5), Fix::from_num(3)),
    Some(Fix::from_num(5))
);
assert_eq!(Fix::MAX.checked_mul_add(Fix::ONE, Fix::ZERO), Some(Fix::MAX));
assert_eq!(Fix::MAX.checked_mul_add(Fix::ONE, Fix::DELTA), None);
// MAX × 1.5 - MAX = MAX / 2, which does not overflow
assert_eq!(Fix::MAX.checked_mul_add(Fix::from_num(1.5), -Fix::MAX), Some(Fix::MAX / 2));
source

pub const fn checked_mul_int(self, rhs: i16) -> Option<FixedI16<Frac>>

Checked multiplication by an integer. Returns the product, or [None] on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::MAX.checked_mul_int(1), Some(Fix::MAX));
assert_eq!(Fix::MAX.checked_mul_int(2), None);
source

pub const fn checked_div_int(self, rhs: i16) -> Option<FixedI16<Frac>>

Checked division by an integer. Returns the quotient, or [None] if the divisor is zero or if the division results in overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::MAX.checked_div_int(1), Some(Fix::MAX));
assert_eq!(Fix::ONE.checked_div_int(0), None);
assert_eq!(Fix::MIN.checked_div_int(-1), None);
source

pub const fn checked_rem_euclid( self, rhs: FixedI16<Frac> ) -> Option<FixedI16<Frac>>

Checked remainder for Euclidean division. Returns the remainder, or [None] if the divisor is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let num = Fix::from_num(7.5);
assert_eq!(num.checked_rem_euclid(Fix::from_num(2)), Some(Fix::from_num(1.5)));
assert_eq!(num.checked_rem_euclid(Fix::ZERO), None);
assert_eq!((-num).checked_rem_euclid(Fix::from_num(2)), Some(Fix::from_num(0.5)));
source

pub const fn checked_shl(self, rhs: u32) -> Option<FixedI16<Frac>>

Checked shift left. Returns the shifted number, or [None] if rhs ≥ 16.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!((Fix::ONE / 2).checked_shl(3), Some(Fix::from_num(4)));
assert_eq!((Fix::ONE / 2).checked_shl(16), None);
source

pub const fn checked_shr(self, rhs: u32) -> Option<FixedI16<Frac>>

Checked shift right. Returns the shifted number, or [None] if rhs ≥ 16.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(4).checked_shr(3), Some(Fix::ONE / 2));
assert_eq!(Fix::from_num(4).checked_shr(16), None);
source

pub const fn checked_abs(self) -> Option<FixedI16<Frac>>

Checked absolute value. Returns the absolute value, or [None] on overflow.

Overflow can only occur when trying to find the absolute value of the minimum value.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(-5).checked_abs(), Some(Fix::from_num(5)));
assert_eq!(Fix::MIN.checked_abs(), None);
source

pub const fn checked_dist(self, other: FixedI16<Frac>) -> Option<FixedI16<Frac>>

Checked distance. Returns the distance from self to other, or [None] on overflow.

The distance is the absolute value of the difference.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::ONE.checked_dist(Fix::from_num(5)), Some(Fix::from_num(4)));
assert_eq!(Fix::MIN.checked_dist(Fix::ZERO), None);
source

pub const fn checked_next_multiple_of( self, other: FixedI16<Frac> ) -> Option<FixedI16<Frac>>

Checked next multiple of other. Returns the next multiple, or [None] if other is zero or on overflow.

The next multiple is the smallest multiple of other that is ≥ self if other is positive, and the largest multiple of other that is ≤ self if other is negative.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::from_num(4).checked_next_multiple_of(Fix::from_num(1.5)),
    Some(Fix::from_num(4.5))
);
assert_eq!(Fix::from_num(4).checked_next_multiple_of(Fix::ZERO), None);
assert_eq!(Fix::MAX.checked_next_multiple_of(Fix::from_num(2)), None);
source

pub const fn checked_inv_lerp<RetFrac>( self, start: FixedI16<Frac>, end: FixedI16<Frac> ) -> Option<FixedI16<RetFrac>>where RetFrac: LeEqU16,

Checked inverse linear interpolation between start and end. Returns [None] on overflow or when start = end.

The computed value can have a fixed-point type like self but with a different number of fractional bits.

Returns (self − start) / (end − start). This is 0 when self = start, and 1 when self = end.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let two = Fix::from_num(2);
let four = Fix::from_num(4);
assert_eq!(Fix::from_num(3).checked_inv_lerp::<U4>(two, four), Some(Fix::from_num(0.5)));
assert_eq!(Fix::from_num(2).checked_inv_lerp::<U4>(two, two), None);
assert_eq!(Fix::MAX.checked_inv_lerp::<U4>(Fix::ZERO, Fix::from_num(0.5)), None);
source

pub const fn checked_add_unsigned( self, rhs: FixedU16<Frac> ) -> Option<FixedI16<Frac>>

Checked addition with an unsigned fixed-point number. Returns the sum, or [None] on overflow.

Examples
use fixed::{types::extra::U4, FixedI16, FixedU16};
type Fix = FixedI16<U4>;
type UFix = FixedU16<U4>;
assert_eq!(
    Fix::from_num(-5).checked_add_unsigned(UFix::from_num(3)),
    Some(Fix::from_num(-2))
);
assert_eq!(Fix::MAX.checked_add_unsigned(UFix::DELTA), None);
source

pub const fn checked_sub_unsigned( self, rhs: FixedU16<Frac> ) -> Option<FixedI16<Frac>>

Checked subtraction with an unsigned fixed-point number. Returns the difference, or [None] on overflow.

Examples
use fixed::{types::extra::U4, FixedI16, FixedU16};
type Fix = FixedI16<U4>;
type UFix = FixedU16<U4>;
assert_eq!(
    Fix::from_num(3).checked_sub_unsigned(UFix::from_num(5)),
    Some(Fix::from_num(-2))
);
assert_eq!(Fix::MIN.checked_sub_unsigned(UFix::DELTA), None);
source

pub const fn saturating_neg(self) -> FixedI16<Frac>

Saturating negation. Returns the negated value, saturating on overflow.

Overflow can only occur when negating the minimum value.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(5).saturating_neg(), Fix::from_num(-5));
assert_eq!(Fix::MIN.saturating_neg(), Fix::MAX);
source

pub const fn saturating_add(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Saturating addition. Returns the sum, saturating on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(3).saturating_add(Fix::from_num(2)), Fix::from_num(5));
assert_eq!(Fix::MAX.saturating_add(Fix::ONE), Fix::MAX);
source

pub const fn saturating_sub(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Saturating subtraction. Returns the difference, saturating on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::ONE.saturating_sub(Fix::from_num(3)), Fix::from_num(-2));
assert_eq!(Fix::MIN.saturating_sub(Fix::ONE), Fix::MIN);
source

pub const fn saturating_mul_add<MulFrac>( self, mul: FixedI16<MulFrac>, add: FixedI16<Frac> ) -> FixedI16<Frac>where MulFrac: LeEqU16,

Saturating multiply and add. Returns self × mul + add, saturating on overflow.

For some cases, the product self × mul would overflow on its own, but the final result self × mul + add is representable; in these cases this method returns the correct result without overflow.

The mul parameter can have a fixed-point type like self but with a different number of fractional bits.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::from_num(4).saturating_mul_add(Fix::from_num(0.5), Fix::from_num(3)),
    Fix::from_num(5)
);
let half_max = Fix::MAX / 2;
assert_eq!(half_max.saturating_mul_add(Fix::from_num(3), half_max), Fix::MAX);
assert_eq!(half_max.saturating_mul_add(Fix::from_num(-5), half_max), Fix::MIN);
// MAX × 1.5 - MAX = MAX / 2, which does not overflow
assert_eq!(Fix::MAX.saturating_mul_add(Fix::from_num(1.5), -Fix::MAX), half_max);
source

pub const fn saturating_mul_int(self, rhs: i16) -> FixedI16<Frac>

Saturating multiplication by an integer. Returns the product, saturating on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(3).saturating_mul_int(2), Fix::from_num(6));
assert_eq!(Fix::MAX.saturating_mul_int(2), Fix::MAX);
source

pub const fn saturating_abs(self) -> FixedI16<Frac>

Saturating absolute value. Returns the absolute value, saturating on overflow.

Overflow can only occur when trying to find the absolute value of the minimum value.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(-5).saturating_abs(), Fix::from_num(5));
assert_eq!(Fix::MIN.saturating_abs(), Fix::MAX);
source

pub const fn saturating_dist(self, other: FixedI16<Frac>) -> FixedI16<Frac>

Saturating distance. Returns the distance from self to other, saturating on overflow.

The distance is the absolute value of the difference.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::ONE.saturating_dist(Fix::from_num(5)), Fix::from_num(4));
assert_eq!(Fix::MIN.saturating_dist(Fix::MAX), Fix::MAX);
source

pub const fn saturating_next_multiple_of( self, other: FixedI16<Frac> ) -> FixedI16<Frac>

Saturating next multiple of other.

The next multiple is the smallest multiple of other that is ≥ self if other is positive, and the largest multiple of other that is ≤ self if other is negative.

Panics

Panics if other is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::from_num(4).saturating_next_multiple_of(Fix::from_num(1.5)),
    Fix::from_num(4.5)
);
assert_eq!(Fix::MAX.saturating_next_multiple_of(Fix::from_num(2)), Fix::MAX);
source

pub const fn saturating_inv_lerp<RetFrac>( self, start: FixedI16<Frac>, end: FixedI16<Frac> ) -> FixedI16<RetFrac>where RetFrac: LeEqU16,

Inverse linear interpolation between start and end, saturating on overflow.

The computed value can have a fixed-point type like self but with a different number of fractional bits.

Returns (self − start) / (end − start). This is 0 when self = start, and 1 when self = end.

Panics

Panics when start = end.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let two = Fix::from_num(2);
let four = Fix::from_num(4);
assert_eq!(Fix::from_num(3).saturating_inv_lerp::<U4>(two, four), 0.5);
assert_eq!(Fix::MAX.saturating_inv_lerp::<U4>(Fix::ZERO, Fix::from_num(0.5)), Fix::MAX);
assert_eq!(Fix::MAX.saturating_inv_lerp::<U4>(Fix::from_num(0.5), Fix::ZERO), Fix::MIN);
source

pub const fn saturating_add_unsigned( self, rhs: FixedU16<Frac> ) -> FixedI16<Frac>

Saturating addition with an unsigned fixed-point number. Returns the sum, saturating on overflow.

Examples
use fixed::{types::extra::U4, FixedI16, FixedU16};
type Fix = FixedI16<U4>;
type UFix = FixedU16<U4>;
assert_eq!(Fix::from_num(-5).saturating_add_unsigned(UFix::from_num(3)), -2);
assert_eq!(Fix::from_num(-5).saturating_add_unsigned(UFix::MAX), Fix::MAX);
source

pub const fn saturating_sub_unsigned( self, rhs: FixedU16<Frac> ) -> FixedI16<Frac>

Saturating subtraction with an unsigned fixed-point number. Returns the difference, saturating on overflow.

Examples
use fixed::{types::extra::U4, FixedI16, FixedU16};
type Fix = FixedI16<U4>;
type UFix = FixedU16<U4>;
assert_eq!(Fix::from_num(3).saturating_sub_unsigned(UFix::from_num(5)), -2);
assert_eq!(Fix::from_num(5).saturating_sub_unsigned(UFix::MAX), Fix::MIN);
source

pub const fn wrapping_neg(self) -> FixedI16<Frac>

Wrapping negation. Returns the negated value, wrapping on overflow.

Overflow can only occur when negating the minimum value.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(5).wrapping_neg(), Fix::from_num(-5));
assert_eq!(Fix::MIN.wrapping_neg(), Fix::MIN);
source

pub const fn wrapping_add(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Wrapping addition. Returns the sum, wrapping on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let one_minus_delta = Fix::ONE - Fix::DELTA;
assert_eq!(Fix::from_num(3).wrapping_add(Fix::from_num(2)), Fix::from_num(5));
assert_eq!(Fix::MAX.wrapping_add(Fix::ONE), Fix::MIN + one_minus_delta);
source

pub const fn wrapping_sub(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Wrapping subtraction. Returns the difference, wrapping on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let one_minus_delta = Fix::ONE - Fix::DELTA;
assert_eq!(Fix::from_num(3).wrapping_sub(Fix::from_num(5)), Fix::from_num(-2));
assert_eq!(Fix::MIN.wrapping_sub(Fix::ONE), Fix::MAX - one_minus_delta);
source

pub const fn wrapping_mul_add<MulFrac>( self, mul: FixedI16<MulFrac>, add: FixedI16<Frac> ) -> FixedI16<Frac>where MulFrac: LeEqU16,

Wrapping multiply and add. Returns self × mul + add, wrapping on overflow.

The mul parameter can have a fixed-point type like self but with a different number of fractional bits.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::from_num(4).wrapping_mul_add(Fix::from_num(0.5), Fix::from_num(3)),
    Fix::from_num(5)
);
assert_eq!(Fix::MAX.wrapping_mul_add(Fix::ONE, Fix::from_num(0)), Fix::MAX);
assert_eq!(Fix::MAX.wrapping_mul_add(Fix::ONE, Fix::from_bits(1)), Fix::MIN);
let wrapped = Fix::MAX.wrapping_mul_int(4);
assert_eq!(Fix::MAX.wrapping_mul_add(Fix::from_num(3), Fix::MAX), wrapped);
source

pub const fn wrapping_mul_int(self, rhs: i16) -> FixedI16<Frac>

Wrapping multiplication by an integer. Returns the product, wrapping on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(3).wrapping_mul_int(2), Fix::from_num(6));
let wrapped = Fix::from_bits(!0 << 2);
assert_eq!(Fix::MAX.wrapping_mul_int(4), wrapped);
source

pub const fn wrapping_div_int(self, rhs: i16) -> FixedI16<Frac>

Wrapping division by an integer. Returns the quotient, wrapping on overflow.

Overflow can only occur when dividing the minimum value by −1.

Panics

Panics if the divisor is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
// 1.5 is binary 1.1
let one_point_5 = Fix::from_bits(0b11 << (4 - 1));
assert_eq!(Fix::from_num(3).wrapping_div_int(2), one_point_5);
assert_eq!(Fix::MIN.wrapping_div_int(-1), Fix::MIN);
source

pub const fn wrapping_shl(self, rhs: u32) -> FixedI16<Frac>

Wrapping shift left. Wraps rhs if rhs ≥ 16, then shifts and returns the number.

Unlike most other methods which wrap the result, this method (as well as wrapping_shr) wraps the input operand rhs.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!((Fix::ONE / 2).wrapping_shl(3), Fix::from_num(4));
assert_eq!((Fix::ONE / 2).wrapping_shl(3 + 16), Fix::from_num(4));
source

pub const fn wrapping_shr(self, rhs: u32) -> FixedI16<Frac>

Wrapping shift right. Wraps rhs if rhs ≥ 16, then shifts and returns the number.

Unlike most other methods which wrap the result, this method (as well as wrapping_shl) wraps the input operand rhs.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!((Fix::from_num(4)).wrapping_shr(3), Fix::ONE / 2);
assert_eq!((Fix::from_num(4)).wrapping_shr(3 + 16), Fix::ONE / 2);
source

pub const fn wrapping_abs(self) -> FixedI16<Frac>

Wrapping absolute value. Returns the absolute value, wrapping on overflow.

Overflow can only occur when trying to find the absolute value of the minimum value.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(-5).wrapping_abs(), Fix::from_num(5));
assert_eq!(Fix::MIN.wrapping_abs(), Fix::MIN);
source

pub const fn wrapping_dist(self, other: FixedI16<Frac>) -> FixedI16<Frac>

Wrapping distance. Returns the distance from self to other, wrapping on overflow.

The distance is the absolute value of the difference.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::ONE.wrapping_dist(Fix::from_num(5)), Fix::from_num(4));
assert_eq!(Fix::MIN.wrapping_dist(Fix::MAX), -Fix::DELTA);
source

pub const fn wrapping_next_multiple_of( self, other: FixedI16<Frac> ) -> FixedI16<Frac>

Wrapping next multiple of other.

The next multiple is the smallest multiple of other that is ≥ self if other is positive, and the largest multiple of other that is ≤ self if other is negative.

Panics

Panics if other is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::from_num(4).wrapping_next_multiple_of(Fix::from_num(1.5)),
    Fix::from_num(4.5)
);
let max_minus_delta = Fix::MAX - Fix::DELTA;
assert_eq!(
    Fix::MAX.wrapping_next_multiple_of(max_minus_delta),
    max_minus_delta.wrapping_mul_int(2)
);
source

pub const fn wrapping_inv_lerp<RetFrac>( self, start: FixedI16<Frac>, end: FixedI16<Frac> ) -> FixedI16<RetFrac>where RetFrac: LeEqU16,

Inverse linear interpolation between start and end, wrapping on overflow.

The computed value can have a fixed-point type like self but with a different number of fractional bits.

Returns (self − start) / (end − start). This is 0 when self = start, and 1 when self = end.

Panics

Panics when start = end.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let two = Fix::from_num(2);
let four = Fix::from_num(4);
assert_eq!(Fix::from_num(3).wrapping_inv_lerp::<U4>(two, four), 0.5);
assert_eq!(
    Fix::MAX.wrapping_inv_lerp::<U4>(Fix::ZERO, Fix::from_num(0.5)),
    Fix::MAX.wrapping_mul_int(2)
);
source

pub const fn wrapping_add_unsigned(self, rhs: FixedU16<Frac>) -> FixedI16<Frac>

Wrapping addition with an unsigned fixed-point number. Returns the sum, wrapping on overflow.

Examples
use fixed::{types::extra::U4, FixedI16, FixedU16};
type Fix = FixedI16<U4>;
type UFix = FixedU16<U4>;
assert_eq!(Fix::from_num(-5).wrapping_add_unsigned(UFix::from_num(3)), -2);
assert_eq!(Fix::ZERO.wrapping_add_unsigned(UFix::MAX), -Fix::DELTA);
source

pub const fn wrapping_sub_unsigned(self, rhs: FixedU16<Frac>) -> FixedI16<Frac>

Wrapping subtraction with an unsigned fixed-point number. Returns the difference, wrapping on overflow.

Examples
use fixed::{types::extra::U4, FixedI16, FixedU16};
type Fix = FixedI16<U4>;
type UFix = FixedU16<U4>;
assert_eq!(Fix::from_num(3).wrapping_sub_unsigned(UFix::from_num(5)), -2);
assert_eq!(Fix::ZERO.wrapping_sub_unsigned(UFix::MAX), Fix::DELTA);
source

pub const fn unwrapped_neg(self) -> FixedI16<Frac>

Unwrapped negation. Returns the negated value, panicking on overflow.

Overflow can only occur when negating the minimum value.

Panics

Panics if the result does not fit.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(5).unwrapped_neg(), Fix::from_num(-5));

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::MIN.unwrapped_neg();
source

pub const fn unwrapped_add(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Unwrapped addition. Returns the sum, panicking on overflow.

Panics

Panics if the result does not fit.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(3).unwrapped_add(Fix::from_num(2)), Fix::from_num(5));

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::MAX.unwrapped_add(Fix::DELTA);
source

pub const fn unwrapped_sub(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Unwrapped subtraction. Returns the difference, panicking on overflow.

Panics

Panics if the result does not fit.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(3).unwrapped_sub(Fix::from_num(5)), Fix::from_num(-2));

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::MIN.unwrapped_sub(Fix::DELTA);
source

pub const fn unwrapped_rem(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Unwrapped remainder. Returns the remainder, panicking if the divisor is zero.

Panics

Panics if the divisor is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(1.5).unwrapped_rem(Fix::ONE), Fix::from_num(0.5));

The following panics because the divisor is zero.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _divisor_is_zero = Fix::from_num(1.5).unwrapped_rem(Fix::ZERO);
source

pub const fn unwrapped_mul_add<MulFrac>( self, mul: FixedI16<MulFrac>, add: FixedI16<Frac> ) -> FixedI16<Frac>where MulFrac: LeEqU16,

Unwrapped multiply and add. Returns self × mul + add, panicking on overflow.

For some cases, the product self × mul would overflow on its own, but the final result self × mul + add is representable; in these cases this method returns the correct result without overflow.

The mul parameter can have a fixed-point type like self but with a different number of fractional bits.

Panics

Panics if the result does not fit.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::from_num(4).unwrapped_mul_add(Fix::from_num(0.5), Fix::from_num(3)),
    Fix::from_num(5)
);
// MAX × 1.5 - MAX = MAX / 2, which does not overflow
assert_eq!(Fix::MAX.unwrapped_mul_add(Fix::from_num(1.5), -Fix::MAX), Fix::MAX / 2);

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::MAX.unwrapped_mul_add(Fix::ONE, Fix::DELTA);
source

pub const fn unwrapped_mul_int(self, rhs: i16) -> FixedI16<Frac>

Unwrapped multiplication by an integer. Returns the product, panicking on overflow.

Panics

Panics if the result does not fit.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(3).unwrapped_mul_int(2), Fix::from_num(6));

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::MAX.unwrapped_mul_int(4);
source

pub const fn unwrapped_div_int(self, rhs: i16) -> FixedI16<Frac>

Unwrapped division by an integer. Returns the quotient, panicking on overflow.

Overflow can only occur when dividing the minimum value by −1.

Panics

Panics if the divisor is zero or if the division results in overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
// 1.5 is binary 1.1
let one_point_5 = Fix::from_bits(0b11 << (4 - 1));
assert_eq!(Fix::from_num(3).unwrapped_div_int(2), one_point_5);

The following panics because the divisor is zero.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _divisor_is_zero = Fix::from_num(3).unwrapped_div_int(0);

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::MIN.unwrapped_div_int(-1);
source

pub const fn unwrapped_rem_euclid(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Unwrapped remainder for Euclidean division. Returns the remainder, panicking if the divisor is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let num = Fix::from_num(7.5);
assert_eq!(num.unwrapped_rem_euclid(Fix::from_num(2)), Fix::from_num(1.5));

The following panics because the divisor is zero.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _divisor_is_zero = Fix::from_num(3).unwrapped_rem_euclid(Fix::ZERO);
source

pub const fn unwrapped_shl(self, rhs: u32) -> FixedI16<Frac>

Unwrapped shift left. Panics if rhs ≥ 16.

Panics

Panics if rhs ≥ 16.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!((Fix::ONE / 2).unwrapped_shl(3), Fix::from_num(4));

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::ONE.unwrapped_shl(16);
source

pub const fn unwrapped_shr(self, rhs: u32) -> FixedI16<Frac>

Unwrapped shift right. Panics if rhs ≥ 16.

Panics

Panics if rhs ≥ 16.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!((Fix::from_num(4)).unwrapped_shr(3), Fix::ONE / 2);

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::ONE.unwrapped_shr(16);
source

pub const fn unwrapped_abs(self) -> FixedI16<Frac>

Unwrapped absolute value. Returns the absolute value, panicking on overflow.

Overflow can only occur when trying to find the absolute value of the minimum value.

Panics

Panics if the result does not fit.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(-5).unwrapped_abs(), Fix::from_num(5));

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::MIN.unwrapped_abs();
source

pub const fn unwrapped_dist(self, other: FixedI16<Frac>) -> FixedI16<Frac>

Unwrapped distance. Returns the distance from self to other, panicking on overflow.

The distance is the absolute value of the difference.

Panics

Panics if the result does not fit.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::ONE.unwrapped_dist(Fix::from_num(5)), Fix::from_num(4));

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::MIN.unwrapped_dist(Fix::ZERO);
source

pub const fn unwrapped_next_multiple_of( self, other: FixedI16<Frac> ) -> FixedI16<Frac>

Returns the next multiple of other, panicking on overflow.

The next multiple is the smallest multiple of other that is ≥ self if other is positive, and the largest multiple of other that is ≤ self if other is negative.

Panics

Panics if other is zero or on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::from_num(4).unwrapped_next_multiple_of(Fix::from_num(1.5)),
    Fix::from_num(4.5)
);

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::MAX.unwrapped_next_multiple_of(Fix::from_num(2));
source

pub const fn unwrapped_inv_lerp<RetFrac>( self, start: FixedI16<Frac>, end: FixedI16<Frac> ) -> FixedI16<RetFrac>where RetFrac: LeEqU16,

Inverse linear interpolation between start and end, panicking on overflow.

The computed value can have a fixed-point type like self but with a different number of fractional bits.

Returns (self − start) / (end − start). This is 0 when self = start, and 1 when self = end.

Panics

Panics when start = end or when the results overflows.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let two = Fix::from_num(2);
let four = Fix::from_num(4);
assert_eq!(Fix::from_num(3).unwrapped_inv_lerp::<U4>(two, four), 0.5);

The following panics because start = end.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let two = Fix::from_num(2);
let _zero_range = two.unwrapped_inv_lerp::<U4>(two, two);

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::MAX.unwrapped_inv_lerp::<U4>(Fix::ZERO, Fix::from_num(0.5));
source

pub const fn unwrapped_add_unsigned(self, rhs: FixedU16<Frac>) -> FixedI16<Frac>

Unwrapped addition with an unsigned fixed-point number. Returns the sum, panicking on overflow.

Panics

Panics if the result does not fit.

Examples
use fixed::{types::extra::U4, FixedI16, FixedU16};
type Fix = FixedI16<U4>;
type UFix = FixedU16<U4>;
assert_eq!(Fix::from_num(-5).unwrapped_add_unsigned(UFix::from_num(3)), -2);

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16, FixedU16};
type Fix = FixedI16<U4>;
type UFix = FixedU16<U4>;
let _overflow = Fix::MAX.unwrapped_add_unsigned(UFix::DELTA);
source

pub const fn unwrapped_sub_unsigned(self, rhs: FixedU16<Frac>) -> FixedI16<Frac>

Unwrapped subtraction with an unsigned fixed-point number. Returns the difference, panicking on overflow.

Panics

Panics if the result does not fit.

Examples
use fixed::{types::extra::U4, FixedI16, FixedU16};
type Fix = FixedI16<U4>;
type UFix = FixedU16<U4>;
assert_eq!(Fix::from_num(3).unwrapped_sub_unsigned(UFix::from_num(5)), -2);

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16, FixedU16};
type Fix = FixedI16<U4>;
type UFix = FixedU16<U4>;
let _overflow = Fix::MIN.unwrapped_sub_unsigned(UFix::DELTA);
source

pub const fn overflowing_neg(self) -> (FixedI16<Frac>, bool)

Overflowing negation.

Returns a [tuple] of the negated value and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Overflow can only occur when negating the minimum value.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(5).overflowing_neg(), (Fix::from_num(-5), false));
assert_eq!(Fix::MIN.overflowing_neg(), (Fix::MIN, true));
source

pub const fn overflowing_add( self, rhs: FixedI16<Frac> ) -> (FixedI16<Frac>, bool)

Overflowing addition.

Returns a [tuple] of the sum and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let one_minus_delta = Fix::ONE - Fix::DELTA;
assert_eq!(Fix::from_num(3).overflowing_add(Fix::from_num(2)), (Fix::from_num(5), false));
assert_eq!(Fix::MAX.overflowing_add(Fix::ONE), (Fix::MIN + one_minus_delta, true));
source

pub const fn overflowing_sub( self, rhs: FixedI16<Frac> ) -> (FixedI16<Frac>, bool)

Overflowing subtraction.

Returns a [tuple] of the difference and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let one_minus_delta = Fix::ONE - Fix::DELTA;
assert_eq!(Fix::from_num(3).overflowing_sub(Fix::from_num(5)), (Fix::from_num(-2), false));
assert_eq!(Fix::MIN.overflowing_sub(Fix::ONE), (Fix::MAX - one_minus_delta, true));
source

pub const fn overflowing_mul_add<MulFrac>( self, mul: FixedI16<MulFrac>, add: FixedI16<Frac> ) -> (FixedI16<Frac>, bool)where MulFrac: LeEqU16,

Overflowing multiply and add.

Returns a [tuple] of self × mul + add and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

For some cases, the product self × mul would overflow on its own, but the final result self × mul + add is representable; in these cases this method returns the correct result without overflow.

The mul parameter can have a fixed-point type like self but with a different number of fractional bits.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::MAX.overflowing_mul_add(Fix::ONE, Fix::ZERO),
    (Fix::MAX, false)
);
assert_eq!(
    Fix::MAX.overflowing_mul_add(Fix::ONE, Fix::DELTA),
    (Fix::MIN, true)
);
assert_eq!(
    Fix::MAX.overflowing_mul_add(Fix::from_num(3), Fix::MAX),
    Fix::MAX.overflowing_mul_int(4)
);
// MAX × 1.5 - MAX = MAX / 2, which does not overflow
assert_eq!(
    Fix::MAX.overflowing_mul_add(Fix::from_num(1.5), -Fix::MAX),
    (Fix::MAX / 2, false)
);
source

pub const fn overflowing_mul_int(self, rhs: i16) -> (FixedI16<Frac>, bool)

Overflowing multiplication by an integer.

Returns a [tuple] of the product and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(3).overflowing_mul_int(2), (Fix::from_num(6), false));
let wrapped = Fix::from_bits(!0 << 2);
assert_eq!(Fix::MAX.overflowing_mul_int(4), (wrapped, true));
source

pub const fn overflowing_div_int(self, rhs: i16) -> (FixedI16<Frac>, bool)

Overflowing division by an integer.

Returns a [tuple] of the quotient and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned. Overflow can only occur when dividing the minimum value by −1.

Panics

Panics if the divisor is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
// 1.5 is binary 1.1
let one_point_5 = Fix::from_bits(0b11 << (4 - 1));
assert_eq!(Fix::from_num(3).overflowing_div_int(2), (one_point_5, false));
assert_eq!(Fix::MIN.overflowing_div_int(-1), (Fix::MIN, true));
source

pub const fn overflowing_shl(self, rhs: u32) -> (FixedI16<Frac>, bool)

Overflowing shift left.

Returns a [tuple] of the shifted value and a [bool] indicating whether an overflow has occurred. Overflow occurs when rhs ≥ 16. On overflow rhs is wrapped before the shift operation.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!((Fix::ONE / 2).overflowing_shl(3), (Fix::from_num(4), false));
assert_eq!((Fix::ONE / 2).overflowing_shl(3 + 16), (Fix::from_num(4), true));
source

pub const fn overflowing_shr(self, rhs: u32) -> (FixedI16<Frac>, bool)

Overflowing shift right.

Returns a [tuple] of the shifted value and a [bool] indicating whether an overflow has occurred. Overflow occurs when rhs ≥ 16. On overflow rhs is wrapped before the shift operation.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!((Fix::from_num(4)).overflowing_shr(3), (Fix::ONE / 2, false));
assert_eq!((Fix::from_num(4)).overflowing_shr(3 + 16), (Fix::ONE / 2, true));
source

pub const fn overflowing_abs(self) -> (FixedI16<Frac>, bool)

Overflowing absolute value.

Returns a [tuple] of the absolute value and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Overflow can only occur when trying to find the absolute value of the minimum value.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(-5).overflowing_abs(), (Fix::from_num(5), false));
assert_eq!(Fix::MIN.overflowing_abs(), (Fix::MIN, true));
source

pub const fn overflowing_dist( self, other: FixedI16<Frac> ) -> (FixedI16<Frac>, bool)

Overflowing distance.

Returns a [tuple] of the distance from self to other and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

The distance is the absolute value of the difference.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::ONE.overflowing_dist(Fix::from_num(5)),
    (Fix::from_num(4), false)
);
assert_eq!(
    Fix::MIN.overflowing_dist(Fix::MAX),
    (-Fix::DELTA, true)
);
source

pub const fn overflowing_next_multiple_of( self, other: FixedI16<Frac> ) -> (FixedI16<Frac>, bool)

Overflowing next multiple of other.

Returns a [tuple] of the next multiple and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

The next multiple is the smallest multiple of other that is ≥ self if other is positive, and the largest multiple of other that is ≤ self if other is negative.

Panics

Panics if other is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::from_num(4).overflowing_next_multiple_of(Fix::from_num(1.5)),
    (Fix::from_num(4.5), false)
);
let max_minus_delta = Fix::MAX - Fix::DELTA;
assert_eq!(
    Fix::MAX.overflowing_next_multiple_of(max_minus_delta),
    (max_minus_delta.wrapping_mul_int(2), true)
);
source

pub const fn overflowing_inv_lerp<RetFrac>( self, start: FixedI16<Frac>, end: FixedI16<Frac> ) -> (FixedI16<RetFrac>, bool)where RetFrac: LeEqU16,

Overflowing inverse linear interpolation between start and end.

Returns a [tuple] of the result and a [bool] indicationg whether an overflow has occurred. On overflow, the wrapped value is returned.

The computed value can have a fixed-point type like self but with a different number of fractional bits.

Computes (self − start) / (end − start). This is 0 when self = start, and 1 when self = end.

Panics

Panics when start = end.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let two = Fix::from_num(2);
let four = Fix::from_num(4);
assert_eq!(
    Fix::from_num(3).overflowing_inv_lerp::<U4>(two, four),
    (Fix::from_num(0.5), false)
);
assert_eq!(
    Fix::MAX.overflowing_inv_lerp::<U4>(Fix::ZERO, Fix::from_num(0.5)),
    (Fix::MAX.wrapping_mul_int(2), true)
);
source

pub const fn overflowing_add_unsigned( self, rhs: FixedU16<Frac> ) -> (FixedI16<Frac>, bool)

Overflowing addition with an unsigned fixed-point number.

Returns a [tuple] of the sum and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Examples
use fixed::{types::extra::U4, FixedI16, FixedU16};
type Fix = FixedI16<U4>;
type UFix = FixedU16<U4>;
assert_eq!(
    Fix::from_num(-5).overflowing_add_unsigned(UFix::from_num(3)),
    (Fix::from_num(-2), false)
);
assert_eq!(
    Fix::ZERO.overflowing_add_unsigned(UFix::MAX),
    (-Fix::DELTA, true)
);
source

pub const fn overflowing_sub_unsigned( self, rhs: FixedU16<Frac> ) -> (FixedI16<Frac>, bool)

Overflowing subtraction with an unsigned fixed-point number.

Returns a [tuple] of the difference and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Examples
use fixed::{types::extra::U4, FixedI16, FixedU16};
type Fix = FixedI16<U4>;
type UFix = FixedU16<U4>;
assert_eq!(
    Fix::from_num(3).overflowing_sub_unsigned(UFix::from_num(5)),
    (Fix::from_num(-2), false)
);
assert_eq!(
    Fix::ZERO.overflowing_sub_unsigned(UFix::MAX),
    (Fix::DELTA, true)
);
source§

impl<Frac> FixedI16<Frac>where Frac: LeEqU16,

The implementation of items in this block depends on the number of fractional bits Frac.

source

pub const INT_NBITS: u32 = i16::BITS - Self::FRAC_NBITS

The number of integer bits.

Examples
use fixed::{types::extra::U6, FixedI16};
type Fix = FixedI16<U6>;
assert_eq!(Fix::INT_NBITS, 16 - 6);
source

pub const FRAC_NBITS: u32 = Frac::U32

The number of fractional bits.

Examples
use fixed::{types::extra::U6, FixedI16};
type Fix = FixedI16<U6>;
assert_eq!(Fix::FRAC_NBITS, 6);
source

pub fn from_num<Src>(src: Src) -> FixedI16<Frac>where Src: ToFixed,

Creates a fixed-point number from another number.

The other number can be:

  • Another fixed-point number. Any extra fractional bits are discarded, which rounds towards −∞.
  • An integer of type [i8], [i16], [i32], [i64], [i128], [isize], [u8], [u16], [u32], [u64], [u128], or [usize].
  • A floating-point number of type f16, bf16, [f32], [f64] or F128. For this conversion, the method rounds to the nearest, with ties rounding to even.
  • Any other number src for which ToFixed is implemented, in which case this method returns src.to_fixed().
Panics

For floating-point numbers, panics if the value is not finite.

When debug assertions are enabled, panics if the value does not fit. When debug assertions are not enabled, the wrapped value can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_from_num instead.

Examples
use fixed::{types::extra::U4, types::I16F16, FixedI16};
type Fix = FixedI16<U4>;

// 1.75 is 1.11 in binary
let src = I16F16::from_bits(0b111 << (16 - 2));
assert_eq!(Fix::from_num(src), Fix::from_bits(0b111 << (4 - 2)));

assert_eq!(Fix::from_num(3i32), Fix::from_bits(3 << 4));
assert_eq!(Fix::from_num(-3i64), Fix::from_bits(-3 << 4));

assert_eq!(Fix::from_num(1.75f32), Fix::from_bits(0b111 << (4 - 2)));
assert_eq!(Fix::from_num(-1.75f64), Fix::from_bits(-0b111 << (4-2)));
source

pub fn to_num<Dst>(self) -> Dstwhere Dst: FromFixed,

Converts a fixed-point number to another number.

The other number can be:

  • Another fixed-point number. Any extra fractional bits are discarded, which rounds towards −∞.
  • An integer of type [i8], [i16], [i32], [i64], [i128], [isize], [u8], [u16], [u32], [u64], [u128], or [usize]. Any fractional bits are discarded, which rounds towards −∞.
  • A floating-point number of type f16, bf16, [f32], [f64] or F128. For this conversion, the method rounds to the nearest, with ties rounding to even.
  • Any other type Dst for which FromFixed is implemented, in which case this method returns Dst::from_fixed(self).
Panics

When debug assertions are enabled, panics if the value does not fit. When debug assertions are not enabled, the wrapped value can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_to_num instead.

Examples
use fixed::{types::extra::U4, types::I30F2, FixedI16};
type Fix = FixedI16<U4>;

// 1.75 is 1.11 in binary
let src = Fix::from_bits(0b111 << (4 - 2));
assert_eq!(src.to_num::<I30F2>(), I30F2::from_bits(0b111));
// src >> 2 is 0.0111, which for I30F2 is truncated to 0.01
assert_eq!((src >> 2u32).to_num::<I30F2>(), I30F2::from_bits(0b1));

// 2.5 is 10.1 in binary
let two_point_5 = Fix::from_bits(0b101 << (4 - 1));
assert_eq!(two_point_5.to_num::<i32>(), 2);
assert_eq!((-two_point_5).to_num::<i64>(), -3);

// 1.625 is 1.101 in binary
let one_point_625 = Fix::from_bits(0b1101 << (4 - 3));
assert_eq!(one_point_625.to_num::<f32>(), 1.625f32);
assert_eq!((-one_point_625).to_num::<f64>(), -1.625f64);
source

pub fn checked_from_num<Src>(src: Src) -> Option<FixedI16<Frac>>where Src: ToFixed,

Creates a fixed-point number from another number if it fits, otherwise returns [None].

The other number can be:

  • Another fixed-point number. Any extra fractional bits are discarded, which rounds towards −∞.
  • An integer of type [i8], [i16], [i32], [i64], [i128], [isize], [u8], [u16], [u32], [u64], [u128], or [usize].
  • A floating-point number of type f16, bf16, [f32], [f64] or F128. For this conversion, the method rounds to the nearest, with ties rounding to even.
  • Any other number src for which ToFixed is implemented, in which case this method returns src.checked_to_fixed().
Examples
use fixed::{
    types::extra::{U2, U4},
    types::I16F16,
    FixedI16,
};
type Fix = FixedI16<U4>;

// 1.75 is 1.11 in binary
let src = I16F16::from_bits(0b111 << (16 - 2));
assert_eq!(Fix::checked_from_num(src), Some(Fix::from_bits(0b111 << (4 - 2))));
let too_large = FixedI16::<U2>::MAX;
assert!(Fix::checked_from_num(too_large).is_none());

assert_eq!(Fix::checked_from_num(3), Some(Fix::from_bits(3 << 4)));
let too_large = i16::MAX;
assert!(Fix::checked_from_num(too_large).is_none());
let too_small = i16::MIN;
assert!(Fix::checked_from_num(too_small).is_none());

// 1.75 is 1.11 in binary
let expected = Fix::from_bits(0b111 << (4 - 2));
assert_eq!(Fix::checked_from_num(1.75f32), Some(expected));
assert_eq!(Fix::checked_from_num(-1.75f64), Some(-expected));
assert!(Fix::checked_from_num(2e38).is_none());
assert!(Fix::checked_from_num(std::f64::NAN).is_none());
source

pub fn checked_to_num<Dst>(self) -> Option<Dst>where Dst: FromFixed,

Converts a fixed-point number to another number if it fits, otherwise returns [None].

The other number can be:

  • Another fixed-point number. Any extra fractional bits are discarded, which rounds towards −∞.
  • An integer of type [i8], [i16], [i32], [i64], [i128], [isize], [u8], [u16], [u32], [u64], [u128], or [usize]. Any fractional bits are discarded, which rounds towards −∞.
  • A floating-point number of type f16, bf16, [f32], [f64] or F128. For this conversion, the method rounds to the nearest, with ties rounding to even.
  • Any other type Dst for which FromFixed is implemented, in which case this method returns Dst::checked_from_fixed(self).
Examples
use fixed::{
    types::extra::{U0, U4, U6},
    types::I16F16,
    FixedI16,
};
type Fix = FixedI16<U4>;

// 1.75 is 1.11 in binary
let src = Fix::from_bits(0b111 << (4 - 2));
let expected = I16F16::from_bits(0b111 << (16 - 2));
assert_eq!(src.checked_to_num::<I16F16>(), Some(expected));
type TooFewIntBits = FixedI16<U6>;
assert!(Fix::MAX.checked_to_num::<TooFewIntBits>().is_none());

// 2.5 is 10.1 in binary
let two_point_5 = Fix::from_bits(0b101 << (4 - 1));
assert_eq!(two_point_5.checked_to_num::<i32>(), Some(2));
assert_eq!((-two_point_5).checked_to_num::<i64>(), Some(-3));
type AllInt = FixedI16<U0>;
assert!(AllInt::from_bits(-1).checked_to_num::<u16>().is_none());

// 1.625 is 1.101 in binary
let one_point_625 = Fix::from_bits(0b1101 << (4 - 3));
assert_eq!(one_point_625.checked_to_num::<f32>(), Some(1.625f32));
source

pub fn saturating_from_num<Src>(src: Src) -> FixedI16<Frac>where Src: ToFixed,

Creates a fixed-point number from another number, saturating if it does not fit.

The other number can be:

  • Another fixed-point number. Any extra fractional bits are discarded, which rounds towards −∞.
  • An integer of type [i8], [i16], [i32], [i64], [i128], [isize], [u8], [u16], [u32], [u64], [u128], or [usize].
  • A floating-point number of type f16, bf16, [f32], [f64] or F128. For this conversion, the method rounds to the nearest, with ties rounding to even.
  • Any other number src for which ToFixed is implemented, in which case this method returns src.saturating_to_fixed().
Panics

This method panics if the value is a floating-point NaN.

Examples
use fixed::{
    types::extra::{U2, U4},
    types::I16F16,
    FixedI16,
};
type Fix = FixedI16<U4>;

// 1.75 is 1.11 in binary
let src = I16F16::from_bits(0b111 << (16 - 2));
assert_eq!(Fix::saturating_from_num(src), Fix::from_bits(0b111 << (4 - 2)));
let too_large = FixedI16::<U2>::MAX;
assert_eq!(Fix::saturating_from_num(too_large), Fix::MAX);

assert_eq!(Fix::saturating_from_num(3), Fix::from_bits(3 << 4));
let too_small = i16::MIN;
assert_eq!(Fix::saturating_from_num(too_small), Fix::MIN);

// 1.75 is 1.11 in binary
let expected = Fix::from_bits(0b111 << (4 - 2));
assert_eq!(Fix::saturating_from_num(1.75f32), expected);
assert_eq!(Fix::saturating_from_num(-1.75f64), -expected);
assert_eq!(Fix::saturating_from_num(2e38), Fix::MAX);
assert_eq!(Fix::saturating_from_num(std::f64::NEG_INFINITY), Fix::MIN);
source

pub fn saturating_to_num<Dst>(self) -> Dstwhere Dst: FromFixed,

Converts a fixed-point number to another number, saturating the value if it does not fit.

The other number can be:

  • Another fixed-point number. Any extra fractional bits are discarded, which rounds towards −∞.
  • An integer of type [i8], [i16], [i32], [i64], [i128], [isize], [u8], [u16], [u32], [u64], [u128], or [usize]. Any fractional bits are discarded, which rounds towards −∞.
  • A floating-point number of type f16, bf16, [f32], [f64] or F128. For this conversion, the method rounds to the nearest, with ties rounding to even.
  • Any other type Dst for which FromFixed is implemented, in which case this method returns Dst::saturating_from_fixed(self).
Examples
use fixed::{
    types::extra::{U0, U4, U6},
    types::I16F16,
    FixedI16,
};
type Fix = FixedI16<U4>;

// 1.75 is 1.11 in binary
let src = Fix::from_bits(0b111 << (4 - 2));
let expected = I16F16::from_bits(0b111 << (16 - 2));
assert_eq!(src.saturating_to_num::<I16F16>(), expected);
type TooFewIntBits = FixedI16<U6>;
let saturated = Fix::MAX.saturating_to_num::<TooFewIntBits>();
assert_eq!(saturated, TooFewIntBits::MAX);

// 2.5 is 10.1 in binary
let two_point_5 = Fix::from_bits(0b101 << (4 - 1));
assert_eq!(two_point_5.saturating_to_num::<i32>(), 2);
type AllInt = FixedI16<U0>;
assert_eq!(AllInt::from_bits(-1).saturating_to_num::<u16>(), 0);

// 1.625 is 1.101 in binary
let one_point_625 = Fix::from_bits(0b1101 << (4 - 3));
assert_eq!(one_point_625.saturating_to_num::<f32>(), 1.625f32);
source

pub fn wrapping_from_num<Src>(src: Src) -> FixedI16<Frac>where Src: ToFixed,

Creates a fixed-point number from another number, wrapping the value on overflow.

The other number can be:

  • Another fixed-point number. Any extra fractional bits are discarded, which rounds towards −∞.
  • An integer of type [i8], [i16], [i32], [i64], [i128], [isize], [u8], [u16], [u32], [u64], [u128], or [usize].
  • A floating-point number of type f16, bf16, [f32], [f64] or F128. For this conversion, the method rounds to the nearest, with ties rounding to even.
  • Any other number src for which ToFixed is implemented, in which case this method returns src.wrapping_to_fixed().
Panics

For floating-point numbers, panics if the value is not finite.

Examples
use fixed::{
    types::extra::{U0, U4},
    types::I16F16,
    FixedI16,
};
type Fix = FixedI16<U4>;

// 1.75 is 1.11 in binary
let src = I16F16::from_bits(0b111 << (16 - 2));
assert_eq!(Fix::wrapping_from_num(src), Fix::from_bits(0b111 << (4 - 2)));
// integer 0b1101 << (16 - 7) will wrap to fixed-point 1010...
let too_large = FixedI16::<U0>::from_bits(0b1101 << (16 - 7));
let wrapped = Fix::from_bits(0b1010 << (16 - 4));
assert_eq!(Fix::wrapping_from_num(too_large), wrapped);

// integer 0b1101 << (16 - 7) will wrap to fixed-point 1010...
let large: i16 = 0b1101 << (16 - 7);
let wrapped = Fix::from_bits(0b1010 << (16 - 4));
assert_eq!(Fix::wrapping_from_num(large), wrapped);

// 1.75 is 1.11 in binary
let expected = Fix::from_bits(0b111 << (4 - 2));
assert_eq!(Fix::wrapping_from_num(1.75f32), expected);
// 1.75 << (16 - 4) wraps to binary 11000...
let large = 1.75 * 2f32.powi(16 - 4);
let wrapped = Fix::from_bits(0b1100 << (16 - 4));
assert_eq!(Fix::wrapping_from_num(large), wrapped);
source

pub fn wrapping_to_num<Dst>(self) -> Dstwhere Dst: FromFixed,

Converts a fixed-point number to another number, wrapping the value on overflow.

The other number can be:

  • Another fixed-point number. Any extra fractional bits are discarded, which rounds towards −∞.
  • An integer of type [i8], [i16], [i32], [i64], [i128], [isize], [u8], [u16], [u32], [u64], [u128], or [usize]. Any fractional bits are discarded, which rounds towards −∞.
  • A floating-point number of type f16, bf16, [f32], [f64] or F128. For this conversion, the method rounds to the nearest, with ties rounding to even.
  • Any other type Dst for which FromFixed is implemented, in which case this method returns Dst::wrapping_from_fixed(self).
Examples
use fixed::{
    types::extra::{U0, U4, U6},
    types::I16F16,
    FixedI16,
};
type Fix = FixedI16<U4>;

// 1.75 is 1.11 in binary
let src = Fix::from_bits(0b111 << (4 - 2));
let expected = I16F16::from_bits(0b111 << (16 - 2));
assert_eq!(src.wrapping_to_num::<I16F16>(), expected);
type TooFewIntBits = FixedI16<U6>;
let wrapped = TooFewIntBits::from_bits(Fix::MAX.to_bits() << 2);
assert_eq!(Fix::MAX.wrapping_to_num::<TooFewIntBits>(), wrapped);

// 2.5 is 10.1 in binary
let two_point_5 = Fix::from_bits(0b101 << (4 - 1));
assert_eq!(two_point_5.wrapping_to_num::<i32>(), 2);
type AllInt = FixedI16<U0>;
assert_eq!(AllInt::from_bits(-1).wrapping_to_num::<u16>(), u16::MAX);

// 1.625 is 1.101 in binary
let one_point_625 = Fix::from_bits(0b1101 << (4 - 3));
assert_eq!(one_point_625.wrapping_to_num::<f32>(), 1.625f32);
source

pub fn unwrapped_from_num<Src>(src: Src) -> FixedI16<Frac>where Src: ToFixed,

Creates a fixed-point number from another number, panicking on overflow.

The other number can be:

  • Another fixed-point number. Any extra fractional bits are discarded, which rounds towards −∞.
  • An integer of type [i8], [i16], [i32], [i64], [i128], [isize], [u8], [u16], [u32], [u64], [u128], or [usize].
  • A floating-point number of type f16, bf16, [f32], [f64] or F128. For this conversion, the method rounds to the nearest, with ties rounding to even.
  • Any other number src for which ToFixed is implemented, in which case this method returns src.unwrapped_to_fixed().
Panics

Panics if the value does not fit.

For floating-point numbers, also panics if the value is not finite.

Examples
use fixed::{
    types::{extra::U4, I16F16},
    FixedI16,
};
type Fix = FixedI16<U4>;

// 1.75 is 1.11 in binary
let src = I16F16::from_bits(0b111 << (16 - 2));
assert_eq!(Fix::unwrapped_from_num(src), Fix::from_bits(0b111 << (4 - 2)));

The following panics because of overflow.

use fixed::{
    types::extra::{U0, U4},
    FixedI16,
};
type Fix = FixedI16<U4>;
let too_large = FixedI16::<U0>::from_bits(0b1101 << (16 - 7));
let _overflow = Fix::unwrapped_from_num(too_large);
source

pub fn unwrapped_to_num<Dst>(self) -> Dstwhere Dst: FromFixed,

Converts a fixed-point number to another number, panicking on overflow.

The other number can be:

  • Another fixed-point number. Any extra fractional bits are discarded, which rounds towards −∞.
  • An integer of type [i8], [i16], [i32], [i64], [i128], [isize], [u8], [u16], [u32], [u64], [u128], or [usize]. Any fractional bits are discarded, which rounds towards −∞.
  • A floating-point number of type f16, bf16, [f32], [f64] or F128. For this conversion, the method rounds to the nearest, with ties rounding to even.
  • Any other type Dst for which FromFixed is implemented, in which case this method returns Dst::unwrapped_from_fixed(self).
Panics

Panics if the value does not fit.

Examples
use fixed::{
    types::{extra::U4, I16F16},
    FixedI16,
};
type Fix = FixedI16<U4>;

// 1.75 is 1.11 in binary
let src = Fix::from_bits(0b111 << (4 - 2));
let expected = I16F16::from_bits(0b111 << (16 - 2));
assert_eq!(src.unwrapped_to_num::<I16F16>(), expected);

The following panics because of overflow.

use fixed::{
    types::extra::{U4, U6},
    FixedI16,
};
type Fix = FixedI16<U4>;
type TooFewIntBits = FixedI16<U6>;
let _overflow = Fix::MAX.unwrapped_to_num::<TooFewIntBits>();
source

pub fn overflowing_from_num<Src>(src: Src) -> (FixedI16<Frac>, bool)where Src: ToFixed,

Creates a fixed-point number from another number.

Returns a [tuple] of the fixed-point number and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

The other number can be:

  • Another fixed-point number. Any extra fractional bits are discarded, which rounds towards −∞.
  • An integer of type [i8], [i16], [i32], [i64], [i128], [isize], [u8], [u16], [u32], [u64], [u128], or [usize].
  • A floating-point number of type f16, bf16, [f32], [f64] or F128. For this conversion, the method rounds to the nearest, with ties rounding to even.
  • Any other number src for which ToFixed is implemented, in which case this method returns src.overflowing_to_fixed().
Panics

For floating-point numbers, panics if the value is not finite.

Examples
use fixed::{
    types::extra::{U0, U4},
    types::I16F16,
    FixedI16,
};
type Fix = FixedI16<U4>;

// 1.75 is 1.11 in binary
let src = I16F16::from_bits(0b111 << (16 - 2));
let expected = Fix::from_bits(0b111 << (4 - 2));
assert_eq!(Fix::overflowing_from_num(src), (expected, false));
// integer 0b1101 << (16 - 7) will wrap to fixed-point 1010...
let too_large = FixedI16::<U0>::from_bits(0b1101 << (16 - 7));
let wrapped = Fix::from_bits(0b1010 << (16 - 4));
assert_eq!(Fix::overflowing_from_num(too_large), (wrapped, true));

assert_eq!(Fix::overflowing_from_num(3), (Fix::from_bits(3 << 4), false));
// integer 0b1101 << (16 - 7) will wrap to fixed-point 1010...
let large: i16 = 0b1101 << (16 - 7);
let wrapped = Fix::from_bits(0b1010 << (16 - 4));
assert_eq!(Fix::overflowing_from_num(large), (wrapped, true));

// 1.75 is 1.11 in binary
let expected = Fix::from_bits(0b111 << (4 - 2));
assert_eq!(Fix::overflowing_from_num(1.75f32), (expected, false));
// 1.75 << (16 - 4) wraps to binary 11000...
let large = 1.75 * 2f32.powi(16 - 4);
let wrapped = Fix::from_bits(0b1100 << (16 - 4));
assert_eq!(Fix::overflowing_from_num(large), (wrapped, true));
source

pub fn overflowing_to_num<Dst>(self) -> (Dst, bool)where Dst: FromFixed,

Converts a fixed-point number to another number.

Returns a [tuple] of the number and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

The other number can be:

  • Another fixed-point number. Any extra fractional bits are discarded, which rounds towards −∞.
  • An integer of type [i8], [i16], [i32], [i64], [i128], [isize], [u8], [u16], [u32], [u64], [u128], or [usize]. Any fractional bits are discarded, which rounds towards −∞.
  • A floating-point number of type f16, bf16, [f32], [f64] or F128. For this conversion, the method rounds to the nearest, with ties rounding to even.
  • Any other type Dst for which FromFixed is implemented, in which case this method returns Dst::overflowing_from_fixed(self).
Examples
use fixed::{
    types::extra::{U0, U4, U6},
    types::I16F16,
    FixedI16,
};
type Fix = FixedI16<U4>;

// 1.75 is 1.11 in binary
let src = Fix::from_bits(0b111 << (4 - 2));
let expected = I16F16::from_bits(0b111 << (16 - 2));
assert_eq!(src.overflowing_to_num::<I16F16>(), (expected, false));
type TooFewIntBits = FixedI16<U6>;
let wrapped = TooFewIntBits::from_bits(Fix::MAX.to_bits() << 2);
assert_eq!(Fix::MAX.overflowing_to_num::<TooFewIntBits>(), (wrapped, true));

// 2.5 is 10.1 in binary
let two_point_5 = Fix::from_bits(0b101 << (4 - 1));
assert_eq!(two_point_5.overflowing_to_num::<i32>(), (2, false));
let does_not_fit = FixedI16::<U0>::from_bits(-1);
let wrapped = 1u16.wrapping_neg();
assert_eq!(does_not_fit.overflowing_to_num::<u16>(), (wrapped, true));

// 1.625 is 1.101 in binary
let one_point_625 = Fix::from_bits(0b1101 << (4 - 3));
assert_eq!(one_point_625.overflowing_to_num::<f32>(), (1.625f32, false));
source

pub const fn const_from_fixed<SrcFrac>(src: FixedI16<SrcFrac>) -> FixedI16<Frac>where SrcFrac: LeEqU16,

Creates a fixed-point number from a fixed-point number with the same underlying integer type. Usable in constant context.

This is equivalent to the unwrapped_from_num method with FixedI16<SrcFrac> as its generic parameter, but can also be used in constant context. Unless required in constant context, use unwrapped_from_num or from_num instead.

Planned deprecation

This method will be deprecated when the unwrapped_from_num method is usable in constant context.

Panics

Panics if the value does not fit.

Examples
use fixed::types::extra::{U2, U4};
use fixed::FixedI16;
type FixA = FixedI16<U2>;
type FixB = FixedI16<U4>;
const A: FixA = FixA::unwrapped_from_str("3.5");
const B: FixB = FixB::const_from_fixed(A);
assert_eq!(B, 3.5);

The following would fail to compile because of overflow.

use fixed::types::extra::{U2, U4};
use fixed::FixedI16;
const _OVERFLOW: FixedI16<U4> = FixedI16::const_from_fixed(FixedI16::<U2>::MAX);
source

pub const fn const_from_int(src: i16) -> FixedI16<Frac>

Creates a fixed-point number from the underlying integer type [i16]. Usable in constant context.

This is equivalent to the unwrapped_from_num method with [i16] as its generic parameter, but can also be used in constant context. Unless required in constant context, use unwrapped_from_num or from_num instead.

Planned deprecation

This method will be deprecated when the unwrapped_from_num method is usable in constant context.

Panics

Panics if the value does not fit.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
const FIVE: Fix = Fix::const_from_int(5);
assert_eq!(FIVE, 5);

The following would fail to compile because of overflow.

use fixed::{types::extra::U4, FixedI16};
const _OVERFLOW: FixedI16<U4> = FixedI16::const_from_int(i16::MAX);
source

pub const fn from_str(src: &str) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing decimal digits to return a fixed-point number.

Rounding is to the nearest, with ties rounded to even.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
// 1.75 is 1.11 in binary
let f = Fix::from_str("1.75");
let check = Fix::from_bits(0b111 << (4 - 2));
assert_eq!(f, Ok(check));
let neg = Fix::from_str("-1.75");
assert_eq!(neg, Ok(-check));
source

pub const fn from_str_binary( src: &str ) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing binary digits to return a fixed-point number.

Rounding is to the nearest, with ties rounded to even.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
// 1.75 is 1.11 in binary
let f = Fix::from_str_binary("1.11");
let check = Fix::from_bits(0b111 << (4 - 2));
assert_eq!(f, Ok(check));
let neg = Fix::from_str_binary("-1.11");
assert_eq!(neg, Ok(-check));
source

pub const fn from_str_octal( src: &str ) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing octal digits to return a fixed-point number.

Rounding is to the nearest, with ties rounded to even.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
// 1.75 is 1.11 in binary, 1.6 in octal
let f = Fix::from_str_octal("1.6");
let check = Fix::from_bits(0b111 << (4 - 2));
assert_eq!(f, Ok(check));
let neg = Fix::from_str_octal("-1.6");
assert_eq!(neg, Ok(-check));
source

pub const fn from_str_hex(src: &str) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing hexadecimal digits to return a fixed-point number.

Rounding is to the nearest, with ties rounded to even.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
// 1.75 is 1.11 in binary, 1.C in hexadecimal
let f = Fix::from_str_hex("1.C");
let check = Fix::from_bits(0b111 << (4 - 2));
assert_eq!(f, Ok(check));
let neg = Fix::from_str_hex("-1.C");
assert_eq!(neg, Ok(-check));
source

pub const fn saturating_from_str( src: &str ) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing decimal digits to return a fixed-point number, saturating on overflow.

Rounding is to the nearest, with ties rounded to even.

Examples
use fixed::types::I8F8;
assert_eq!(I8F8::saturating_from_str("9999"), Ok(I8F8::MAX));
assert_eq!(I8F8::saturating_from_str("-9999"), Ok(I8F8::MIN));
source

pub const fn saturating_from_str_binary( src: &str ) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing binary digits to return a fixed-point number, saturating on overflow.

Rounding is to the nearest, with ties rounded to even.

Examples
use fixed::types::I8F8;
assert_eq!(I8F8::saturating_from_str_binary("101100111000"), Ok(I8F8::MAX));
assert_eq!(I8F8::saturating_from_str_binary("-101100111000"), Ok(I8F8::MIN));
source

pub const fn saturating_from_str_octal( src: &str ) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing octal digits to return a fixed-point number, saturating on overflow.

Rounding is to the nearest, with ties rounded to even.

Examples
use fixed::types::I8F8;
assert_eq!(I8F8::saturating_from_str_octal("7777"), Ok(I8F8::MAX));
assert_eq!(I8F8::saturating_from_str_octal("-7777"), Ok(I8F8::MIN));
source

pub const fn saturating_from_str_hex( src: &str ) -> Result<FixedI16<Frac>, ParseFixedError>

Prases a string slice containing hexadecimal digits to return a fixed-point number, saturating on overflow.

Rounding is to the nearest, with ties rounded to even.

Examples
use fixed::types::I8F8;
assert_eq!(I8F8::saturating_from_str_hex("FFFF"), Ok(I8F8::MAX));
assert_eq!(I8F8::saturating_from_str_hex("-FFFF"), Ok(I8F8::MIN));
source

pub const fn wrapping_from_str( src: &str ) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing decimal digits to return a fixed-point number, wrapping on overflow.

Rounding is to the nearest, with ties rounded to even.

Examples
use fixed::types::I8F8;
// 9999.5 = 15.5 + 256 × n
assert_eq!(I8F8::wrapping_from_str("9999.5"), Ok(I8F8::from_num(15.5)));
assert_eq!(I8F8::wrapping_from_str("-9999.5"), Ok(I8F8::from_num(-15.5)));
source

pub const fn wrapping_from_str_binary( src: &str ) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing binary digits to return a fixed-point number, wrapping on overflow.

Rounding is to the nearest, with ties rounded to even.

Examples
use fixed::types::I8F8;
let check = I8F8::from_bits(0b1110001 << (8 - 1));
assert_eq!(I8F8::wrapping_from_str_binary("101100111000.1"), Ok(check));
assert_eq!(I8F8::wrapping_from_str_binary("-101100111000.1"), Ok(-check));
source

pub const fn wrapping_from_str_octal( src: &str ) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing octal digits to return a fixed-point number, wrapping on overflow.

Rounding is to the nearest, with ties rounded to even.

Examples
use fixed::types::I8F8;
let check = I8F8::from_bits(0o1654 << (8 - 3));
assert_eq!(I8F8::wrapping_from_str_octal("7165.4"), Ok(check));
assert_eq!(I8F8::wrapping_from_str_octal("-7165.4"), Ok(-check));
source

pub const fn wrapping_from_str_hex( src: &str ) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing hexadecimal digits to return a fixed-point number, wrapping on overflow.

Rounding is to the nearest, with ties rounded to even.

Examples
use fixed::types::I8F8;
let check = I8F8::from_bits(0xFFE);
assert_eq!(I8F8::wrapping_from_str_hex("C0F.FE"), Ok(check));
assert_eq!(I8F8::wrapping_from_str_hex("-C0F.FE"), Ok(-check));
source

pub const fn unwrapped_from_str(src: &str) -> FixedI16<Frac>

Parses a string slice containing decimal digits to return a fixed-point number, panicking on overflow.

Rounding is to the nearest, with ties rounded to even.

Panics

Panics if the value does not fit or if there is a parsing error.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
// 1.75 is 1.11 in binary
let f = Fix::unwrapped_from_str("1.75");
assert_eq!(f, Fix::from_bits(0b111 << (4 - 2)));

The following panics because of a parsing error.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _error = Fix::unwrapped_from_str("1.75.");
source

pub const fn unwrapped_from_str_binary(src: &str) -> FixedI16<Frac>

Parses a string slice containing binary digits to return a fixed-point number, panicking on overflow.

Rounding is to the nearest, with ties rounded to even.

Panics

Panics if the value does not fit or if there is a parsing error.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
// 1.75 is 1.11 in binary
let f = Fix::unwrapped_from_str_binary("1.11");
assert_eq!(f, Fix::from_bits(0b111 << (4 - 2)));

The following panics because of a parsing error.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _error = Fix::unwrapped_from_str_binary("1.2");
source

pub const fn unwrapped_from_str_octal(src: &str) -> FixedI16<Frac>

Parses a string slice containing octal digits to return a fixed-point number, panicking on overflow.

Rounding is to the nearest, with ties rounded to even.

Panics

Panics if the value does not fit or if there is a parsing error.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
// 1.75 is 1.11 in binary, 1.6 in octal
let f = Fix::unwrapped_from_str_octal("1.6");
assert_eq!(f, Fix::from_bits(0b111 << (4 - 2)));

The following panics because of a parsing error.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _error = Fix::unwrapped_from_str_octal("1.8");
source

pub const fn unwrapped_from_str_hex(src: &str) -> FixedI16<Frac>

Parses a string slice containing hexadecimal digits to return a fixed-point number, wrapping on overflow.

Rounding is to the nearest, with ties rounded to even.

Panics

Panics if the value does not fit or if there is a parsing error.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
// 1.75 is 1.11 in binary, 1.C in hexadecimal
let f = Fix::unwrapped_from_str_hex("1.C");
assert_eq!(f, Fix::from_bits(0b111 << (4 - 2)));

The following panics because of a parsing error.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _error = Fix::unwrapped_from_str_hex("1.G");
source

pub const fn overflowing_from_str( src: &str ) -> Result<(FixedI16<Frac>, bool), ParseFixedError>

Parses a string slice containing decimal digits to return a fixed-point number.

Returns a [tuple] of the fixed-point number and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Rounding is to the nearest, with ties rounded to even.

Examples
use fixed::types::I8F8;
assert_eq!(I8F8::overflowing_from_str("99.5"), Ok((I8F8::from_num(99.5), false)));
// 9999.5 = 15.5 + 256 × n
assert_eq!(I8F8::overflowing_from_str("-9999.5"), Ok((I8F8::from_num(-15.5), true)));
source

pub const fn overflowing_from_str_binary( src: &str ) -> Result<(FixedI16<Frac>, bool), ParseFixedError>

Parses a string slice containing binary digits to return a fixed-point number.

Returns a [tuple] of the fixed-point number and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Rounding is to the nearest, with ties rounded to even.

Examples
use fixed::types::I8F8;
let check = I8F8::from_bits(0b1110001 << (8 - 1));
assert_eq!(I8F8::overflowing_from_str_binary("111000.1"), Ok((check, false)));
assert_eq!(I8F8::overflowing_from_str_binary("-101100111000.1"), Ok((-check, true)));
source

pub const fn overflowing_from_str_octal( src: &str ) -> Result<(FixedI16<Frac>, bool), ParseFixedError>

Parses a string slice containing octal digits to return a fixed-point number.

Returns a [tuple] of the fixed-point number and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Rounding is to the nearest, with ties rounded to even.

Examples
use fixed::types::I8F8;
let check = I8F8::from_bits(0o1654 << (8 - 3));
assert_eq!(I8F8::overflowing_from_str_octal("165.4"), Ok((check, false)));
assert_eq!(I8F8::overflowing_from_str_octal("-7165.4"), Ok((-check, true)));
source

pub const fn overflowing_from_str_hex( src: &str ) -> Result<(FixedI16<Frac>, bool), ParseFixedError>

Parses a string slice containing hexadecimal digits to return a fixed-point number.

Returns a [tuple] of the fixed-point number and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Rounding is to the nearest, with ties rounded to even.

Examples
use fixed::types::I8F8;
let check = I8F8::from_bits(0xFFE);
assert_eq!(I8F8::overflowing_from_str_hex("F.FE"), Ok((check, false)));
assert_eq!(I8F8::overflowing_from_str_hex("-C0F.FE"), Ok((-check, true)));
source

pub const fn int(self) -> FixedI16<Frac>

Returns the integer part.

Note that since the numbers are stored in two’s complement, negative numbers with non-zero fractional parts will be rounded towards −∞, except in the case where there are no integer bits, that is FixedI16<U16>, where the return value is always zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
// 0010.0000
let two = Fix::from_num(2);
// 0010.0100
let two_and_quarter = two + two / 8;
assert_eq!(two_and_quarter.int(), two);
// 1101.0000
let three = Fix::from_num(3);
// 1101.1100
assert_eq!((-two_and_quarter).int(), -three);
source

pub const fn frac(self) -> FixedI16<Frac>

Returns the fractional part.

Note that since the numbers are stored in two’s complement, the returned fraction will be non-negative for negative numbers, except in the case where there are no integer bits, that is FixedI16<U16> where the return value is always equal to self.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
// 0000.0100
let quarter = Fix::ONE / 4;
// 0010.0100
let two_and_quarter = quarter * 9;
assert_eq!(two_and_quarter.frac(), quarter);
// 0000.1100
let three_quarters = quarter * 3;
// 1101.1100
assert_eq!((-two_and_quarter).frac(), three_quarters);
source

pub const fn round_to_zero(self) -> FixedI16<Frac>

Rounds to the next integer towards 0.

Note that for negative numbers, this is different from truncating/discarding the fractional bits. This is because in two’s-complement representations, the value of all the bits except for the most significant bit is positive; discarding positive bits would round towards −∞ unlike this method which rounds towards zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.1).round_to_zero(), Fix::from_num(2));
assert_eq!(Fix::from_num(2.9).round_to_zero(), Fix::from_num(2));
assert_eq!(Fix::from_num(-2.1).round_to_zero(), Fix::from_num(-2));
assert_eq!(Fix::from_num(-2.9).round_to_zero(), Fix::from_num(-2));
source

pub const fn ceil(self) -> FixedI16<Frac>

Rounds to the next integer towards +∞.

Panics

When debug assertions are enabled, panics if the result does not fit. When debug assertions are not enabled, the wrapped result can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_ceil instead.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).ceil(), Fix::from_num(3));
assert_eq!(Fix::from_num(-2.5).ceil(), Fix::from_num(-2));
source

pub const fn floor(self) -> FixedI16<Frac>

Rounds to the next integer towards −∞.

Panics

When debug assertions are enabled, panics if the result does not fit. When debug assertions are not enabled, the wrapped result can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_floor instead.

Overflow can only occur when there are zero integer bits.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).floor(), Fix::from_num(2));
assert_eq!(Fix::from_num(-2.5).floor(), Fix::from_num(-3));
source

pub const fn round(self) -> FixedI16<Frac>

Rounds to the nearest integer, with ties rounded away from zero.

Panics

When debug assertions are enabled, panics if the result does not fit. When debug assertions are not enabled, the wrapped result can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_round instead.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).round(), Fix::from_num(3));
assert_eq!(Fix::from_num(-2.5).round(), Fix::from_num(-3));
source

pub const fn round_ties_to_even(self) -> FixedI16<Frac>

Rounds to the nearest integer, with ties rounded to even.

Panics

When debug assertions are enabled, panics if the result does not fit. When debug assertions are not enabled, the wrapped result can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_round_ties_to_even instead.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).round_ties_to_even(), Fix::from_num(2));
assert_eq!(Fix::from_num(3.5).round_ties_to_even(), Fix::from_num(4));
source

pub const fn checked_ceil(self) -> Option<FixedI16<Frac>>

Checked ceil. Rounds to the next integer towards +∞, returning [None] on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).checked_ceil(), Some(Fix::from_num(3)));
assert_eq!(Fix::from_num(-2.5).checked_ceil(), Some(Fix::from_num(-2)));
assert!(Fix::MAX.checked_ceil().is_none());
source

pub const fn checked_floor(self) -> Option<FixedI16<Frac>>

Checked floor. Rounds to the next integer towards −∞.Returns [None] on overflow.

Overflow can only occur when there are zero integer bits.

Examples
use fixed::{
    types::extra::{U4, U16},
    FixedI16,
};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).checked_floor(), Some(Fix::from_num(2)));
assert_eq!(Fix::from_num(-2.5).checked_floor(), Some(Fix::from_num(-3)));
type AllFrac = FixedI16<U16>;
assert!(AllFrac::MIN.checked_floor().is_none());
source

pub const fn checked_round(self) -> Option<FixedI16<Frac>>

Checked round. Rounds to the nearest integer, with ties rounded away from zero, returning [None] on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).checked_round(), Some(Fix::from_num(3)));
assert_eq!(Fix::from_num(-2.5).checked_round(), Some(Fix::from_num(-3)));
assert!(Fix::MAX.checked_round().is_none());
source

pub const fn checked_round_ties_to_even(self) -> Option<FixedI16<Frac>>

Checked round. Rounds to the nearest integer, with ties rounded to even, returning [None] on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).checked_round_ties_to_even(), Some(Fix::from_num(2)));
assert_eq!(Fix::from_num(3.5).checked_round_ties_to_even(), Some(Fix::from_num(4)));
assert!(Fix::MAX.checked_round_ties_to_even().is_none());
source

pub const fn saturating_ceil(self) -> FixedI16<Frac>

Saturating ceil. Rounds to the next integer towards +∞, saturating on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).saturating_ceil(), Fix::from_num(3));
assert_eq!(Fix::from_num(-2.5).saturating_ceil(), Fix::from_num(-2));
assert_eq!(Fix::MAX.saturating_ceil(), Fix::MAX);
source

pub const fn saturating_floor(self) -> FixedI16<Frac>

Saturating floor. Rounds to the next integer towards −∞, saturating on overflow.

Overflow can only occur when there are zero integer bits.

Examples
use fixed::{
    types::extra::{U4, U16},
    FixedI16,
};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).saturating_floor(), Fix::from_num(2));
assert_eq!(Fix::from_num(-2.5).saturating_floor(), Fix::from_num(-3));
type AllFrac = FixedI16<U16>;
assert_eq!(AllFrac::MIN.saturating_floor(), AllFrac::MIN);
source

pub const fn saturating_round(self) -> FixedI16<Frac>

Saturating round. Rounds to the nearest integer, with ties rounded away from zero, and saturating on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).saturating_round(), Fix::from_num(3));
assert_eq!(Fix::from_num(-2.5).saturating_round(), Fix::from_num(-3));
assert_eq!(Fix::MAX.saturating_round(), Fix::MAX);
source

pub const fn saturating_round_ties_to_even(self) -> FixedI16<Frac>

Saturating round. Rounds to the nearest integer, with ties rounded to even, and saturating on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).saturating_round_ties_to_even(), Fix::from_num(2));
assert_eq!(Fix::from_num(3.5).saturating_round_ties_to_even(), Fix::from_num(4));
assert_eq!(Fix::MAX.saturating_round_ties_to_even(), Fix::MAX);
source

pub const fn wrapping_ceil(self) -> FixedI16<Frac>

Wrapping ceil. Rounds to the next integer towards +∞, wrapping on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).wrapping_ceil(), Fix::from_num(3));
assert_eq!(Fix::from_num(-2.5).wrapping_ceil(), Fix::from_num(-2));
assert_eq!(Fix::MAX.wrapping_ceil(), Fix::MIN);
source

pub const fn wrapping_floor(self) -> FixedI16<Frac>

Wrapping floor. Rounds to the next integer towards −∞, wrapping on overflow.

Overflow can only occur when there are zero integer bits.

Examples
use fixed::{
    types::extra::{U4, U16},
    FixedI16,
};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).wrapping_floor(), Fix::from_num(2));
assert_eq!(Fix::from_num(-2.5).wrapping_floor(), Fix::from_num(-3));
type AllFrac = FixedI16<U16>;
assert_eq!(AllFrac::MIN.wrapping_floor(), AllFrac::ZERO);
source

pub const fn wrapping_round(self) -> FixedI16<Frac>

Wrapping round. Rounds to the next integer to the nearest, with ties rounded away from zero, and wrapping on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).wrapping_round(), Fix::from_num(3));
assert_eq!(Fix::from_num(-2.5).wrapping_round(), Fix::from_num(-3));
assert_eq!(Fix::MAX.wrapping_round(), Fix::MIN);
source

pub const fn wrapping_round_ties_to_even(self) -> FixedI16<Frac>

Wrapping round. Rounds to the next integer to the nearest, with ties rounded to even, and wrapping on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).wrapping_round_ties_to_even(), Fix::from_num(2));
assert_eq!(Fix::from_num(3.5).wrapping_round_ties_to_even(), Fix::from_num(4));
assert_eq!(Fix::MAX.wrapping_round_ties_to_even(), Fix::MIN);
source

pub const fn unwrapped_ceil(self) -> FixedI16<Frac>

Unwrapped ceil. Rounds to the next integer towards +∞, panicking on overflow.

Panics

Panics if the result does not fit.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).unwrapped_ceil(), Fix::from_num(3));
assert_eq!(Fix::from_num(-2.5).unwrapped_ceil(), Fix::from_num(-2));

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::MAX.unwrapped_ceil();
source

pub const fn unwrapped_floor(self) -> FixedI16<Frac>

Unwrapped floor. Rounds to the next integer towards −∞, panicking on overflow.

Overflow can only occur when there are zero integer bits.

Panics

Panics if the result does not fit.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).unwrapped_floor(), Fix::from_num(2));
assert_eq!(Fix::from_num(-2.5).unwrapped_floor(), Fix::from_num(-3));

The following panics because of overflow.

use fixed::{types::extra::U16, FixedI16};
type AllFrac = FixedI16<U16>;
let _overflow = AllFrac::MIN.unwrapped_floor();
source

pub const fn unwrapped_round(self) -> FixedI16<Frac>

Unwrapped round. Rounds to the next integer to the nearest, with ties rounded away from zero, and panicking on overflow.

Panics

Panics if the result does not fit.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).unwrapped_round(), Fix::from_num(3));
assert_eq!(Fix::from_num(-2.5).unwrapped_round(), Fix::from_num(-3));

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::MAX.unwrapped_round();
source

pub const fn unwrapped_round_ties_to_even(self) -> FixedI16<Frac>

Unwrapped round. Rounds to the next integer to the nearest, with ties rounded to even, and panicking on overflow.

Panics

Panics if the result does not fit.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).unwrapped_round_ties_to_even(), Fix::from_num(2));
assert_eq!(Fix::from_num(3.5).unwrapped_round_ties_to_even(), Fix::from_num(4));

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::MAX.unwrapped_round_ties_to_even();
source

pub const fn overflowing_ceil(self) -> (FixedI16<Frac>, bool)

Overflowing ceil. Rounds to the next integer towards +∞.

Returns a [tuple] of the fixed-point number and a [bool], indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).overflowing_ceil(), (Fix::from_num(3), false));
assert_eq!(Fix::from_num(-2.5).overflowing_ceil(), (Fix::from_num(-2), false));
assert_eq!(Fix::MAX.overflowing_ceil(), (Fix::MIN, true));
source

pub const fn overflowing_floor(self) -> (FixedI16<Frac>, bool)

Overflowing floor. Rounds to the next integer towards −∞.

Returns a [tuple] of the fixed-point number and a [bool], indicating whether an overflow has occurred. On overflow, the wrapped value isreturned. Overflow can only occur when there are zero integer bits.

Examples
use fixed::{
    types::extra::{U4, U16},
    FixedI16,
};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).overflowing_floor(), (Fix::from_num(2), false));
assert_eq!(Fix::from_num(-2.5).overflowing_floor(), (Fix::from_num(-3), false));
type AllFrac = FixedI16<U16>;
assert_eq!(AllFrac::MIN.overflowing_floor(), (AllFrac::ZERO, true));
source

pub const fn overflowing_round(self) -> (FixedI16<Frac>, bool)

Overflowing round. Rounds to the next integer to the nearest, with ties rounded away from zero.

Returns a [tuple] of the fixed-point number and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).overflowing_round(), (Fix::from_num(3), false));
assert_eq!(Fix::from_num(-2.5).overflowing_round(), (Fix::from_num(-3), false));
assert_eq!(Fix::MAX.overflowing_round(), (Fix::MIN, true));
source

pub const fn overflowing_round_ties_to_even(self) -> (FixedI16<Frac>, bool)

Overflowing round. Rounds to the next integer to the nearest, with ties rounded to even.

Returns a [tuple] of the fixed-point number and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2.5).overflowing_round_ties_to_even(), (Fix::from_num(2), false));
assert_eq!(Fix::from_num(3.5).overflowing_round_ties_to_even(), (Fix::from_num(4), false));
assert_eq!(Fix::MAX.overflowing_round_ties_to_even(), (Fix::MIN, true));
source

pub const fn int_log2(self) -> i32

Integer base-2 logarithm, rounded down.

Panics

Panics if the fixed-point number is ≤ 0.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(4).int_log2(), 2);
assert_eq!(Fix::from_num(3.9375).int_log2(), 1);
assert_eq!(Fix::from_num(0.25).int_log2(), -2);
assert_eq!(Fix::from_num(0.1875).int_log2(), -3);
source

pub const fn int_log10(self) -> i32

Integer base-10 logarithm, rounded down.

Panics

Panics if the fixed-point number is ≤ 0.

Examples
use fixed::{
    types::extra::{U2, U6},
    FixedI16,
};
assert_eq!(FixedI16::<U2>::from_num(10).int_log10(), 1);
assert_eq!(FixedI16::<U2>::from_num(9.75).int_log10(), 0);
assert_eq!(FixedI16::<U6>::from_num(0.109375).int_log10(), -1);
assert_eq!(FixedI16::<U6>::from_num(0.09375).int_log10(), -2);
source

pub const fn int_log(self, base: u32) -> i32

Integer logarithm to the specified base, rounded down.

Panics

Panics if the fixed-point number is ≤ 0 or if the base is < 2.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(4).int_log(2), 2);
assert_eq!(Fix::from_num(5.75).int_log(5), 1);
assert_eq!(Fix::from_num(0.25).int_log(5), -1);
assert_eq!(Fix::from_num(0.1875).int_log(5), -2);
source

pub const fn checked_int_log2(self) -> Option<i32>

Checked integer base-2 logarithm, rounded down. Returns the logarithm or [None] if the fixed-point number is ≤ 0.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::ZERO.checked_int_log2(), None);
assert_eq!(Fix::from_num(4).checked_int_log2(), Some(2));
assert_eq!(Fix::from_num(3.9375).checked_int_log2(), Some(1));
assert_eq!(Fix::from_num(0.25).checked_int_log2(), Some(-2));
assert_eq!(Fix::from_num(0.1875).checked_int_log2(), Some(-3));
source

pub const fn checked_int_log10(self) -> Option<i32>

Checked integer base-10 logarithm, rounded down. Returns the logarithm or [None] if the fixed-point number is ≤ 0.

Examples
use fixed::{
    types::extra::{U2, U6},
    FixedI16,
};
assert_eq!(FixedI16::<U2>::ZERO.checked_int_log10(), None);
assert_eq!(FixedI16::<U2>::from_num(10).checked_int_log10(), Some(1));
assert_eq!(FixedI16::<U2>::from_num(9.75).checked_int_log10(), Some(0));
assert_eq!(FixedI16::<U6>::from_num(0.109375).checked_int_log10(), Some(-1));
assert_eq!(FixedI16::<U6>::from_num(0.09375).checked_int_log10(), Some(-2));
source

pub const fn checked_int_log(self, base: u32) -> Option<i32>

Checked integer logarithm to the specified base, rounded down. Returns the logarithm, or [None] if the fixed-point number is ≤ 0 or if the base is < 2.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::ZERO.checked_int_log(5), None);
assert_eq!(Fix::from_num(4).checked_int_log(2), Some(2));
assert_eq!(Fix::from_num(5.75).checked_int_log(5), Some(1));
assert_eq!(Fix::from_num(0.25).checked_int_log(5), Some(-1));
assert_eq!(Fix::from_num(0.1875).checked_int_log(5), Some(-2));
source

pub const fn signum(self) -> FixedI16<Frac>

Returns a number representing the sign of self.

Panics

When debug assertions are enabled, this method panics

  • if the value is positive and the fixed-point number has zero or one integer bits such that it cannot hold the value 1.
  • if the value is negative and the fixed-point number has zero integer bits, such that it cannot hold the value −1.

When debug assertions are not enabled, the wrapped value can be returned in those cases, but it is not considered a breaking change if in the future it panics; using this method when 1 and −1 cannot be represented is almost certainly a bug.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(5).signum(), 1);
assert_eq!(Fix::ZERO.signum(), 0);
assert_eq!(Fix::from_num(-5).signum(), -1);
source

pub const fn recip(self) -> FixedI16<Frac>

Returns the reciprocal (inverse) of the fixed-point number, 1/self.

Panics

Panics if the fixed-point number is zero.

When debug assertions are enabled, this method also panics if the reciprocal overflows. When debug assertions are not enabled, the wrapped value can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_recip instead.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2).recip(), Fix::from_num(0.5));
source

pub const fn div_euclid(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Euclidean division.

Panics

Panics if the divisor is zero.

When debug assertions are enabled, this method also panics if the division overflows. When debug assertions are not enabled, the wrapped value can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_div_euclid instead.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(7.5).div_euclid(Fix::from_num(2)), Fix::from_num(3));
assert_eq!(Fix::from_num(-7.5).div_euclid(Fix::from_num(2)), Fix::from_num(-4));
source

pub const fn div_euclid_int(self, rhs: i16) -> FixedI16<Frac>

Euclidean division by an integer.

Panics

Panics if the divisor is zero.

When debug assertions are enabled, this method also panics if the division overflows. Overflow can only occur when dividing the minimum value by −1. When debug assertions are not enabled, the wrapped value can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_div_euclid_int instead.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(7.5).div_euclid_int(2), Fix::from_num(3));
assert_eq!(Fix::from_num(-7.5).div_euclid_int(2), Fix::from_num(-4));
source

pub const fn add_prod<AFrac, BFrac>( self, a: FixedI16<AFrac>, b: FixedI16<BFrac> ) -> FixedI16<Frac>where AFrac: LeEqU16, BFrac: LeEqU16,

Adds self to the product a × b.

For some cases, the product a × b would overflow on its own, but the final result self + a × b is representable; in these cases this method returns the correct result without overflow.

The a and b parameters can have a fixed-point type like self but with a different number of fractional bits.

The mul_acc method performs the same operation as this method but mutates self instead of returning the result.

Panics

When debug assertions are enabled, this method panics if the result overflows. When debug assertions are not enabled, the wrapped value can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_add_prod instead.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(3).add_prod(Fix::from_num(4), Fix::from_num(0.5)), 5);
// -MAX + MAX × 1.5 = MAX / 2, which does not overflow
assert_eq!((-Fix::MAX).add_prod(Fix::MAX, Fix::from_num(1.5)), Fix::MAX / 2);
source

pub fn mul_acc<AFrac, BFrac>(&mut self, a: FixedI16<AFrac>, b: FixedI16<BFrac>)where AFrac: LeEqU16, BFrac: LeEqU16,

Multiply and accumulate. Adds (a × b) to self.

For some cases, the product a × b would overflow on its own, but the final result self + a × b is representable; in these cases this method saves the correct result without overflow.

The a and b parameters can have a fixed-point type like self but with a different number of fractional bits.

The add_prod method performs the same operation as this method but returns the result instead of mutating self.

Panics

When debug assertions are enabled, this method panics if the result overflows. When debug assertions are not enabled, the wrapped value can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_mul_acc instead.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let mut acc = Fix::from_num(3);
acc.mul_acc(Fix::from_num(4), Fix::from_num(0.5));
assert_eq!(acc, 5);

// MAX × 1.5 - MAX = MAX / 2, which does not overflow
acc = -Fix::MAX;
acc.mul_acc(Fix::MAX, Fix::from_num(1.5));
assert_eq!(acc, Fix::MAX / 2);
source

pub const fn rem_euclid_int(self, rhs: i16) -> FixedI16<Frac>

Remainder for Euclidean division by an integer.

Panics

Panics if the divisor is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(7.5).rem_euclid_int(2), Fix::from_num(1.5));
assert_eq!(Fix::from_num(-7.5).rem_euclid_int(2), Fix::from_num(0.5));
source

pub const fn lerp<RangeFrac>( self, start: FixedI16<RangeFrac>, end: FixedI16<RangeFrac> ) -> FixedI16<RangeFrac>

Linear interpolation between start and end.

Returns start + self × (end − start). This is start when self = 0, end when self = 1, and linear interpolation for all other values of self. Linear extrapolation is performed if self is not in the range 0 ≤ x ≤ 1.

Panics

When debug assertions are enabled, this method panics if the result overflows. When debug assertions are not enabled, the wrapped value can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_lerp instead.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let start = Fix::from_num(2);
let end = Fix::from_num(3.5);
assert_eq!(Fix::from_num(-1.0).lerp(start, end), 0.5);
assert_eq!(Fix::from_num(0.0).lerp(start, end), 2);
assert_eq!(Fix::from_num(0.5).lerp(start, end), 2.75);
assert_eq!(Fix::from_num(1.0).lerp(start, end), 3.5);
assert_eq!(Fix::from_num(2.0).lerp(start, end), 5);
source

pub const fn checked_signum(self) -> Option<FixedI16<Frac>>

Checked signum. Returns a number representing the sign of self, or [None] on overflow.

Overflow can only occur

  • if the value is positive and the fixed-point number has zero or one integer bits such that it cannot hold the value 1.
  • if the value is negative and the fixed-point number has zero integer bits, such that it cannot hold the value −1.
Examples
use fixed::{
    types::extra::{U4, U15, U16},
    FixedI16,
};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(5).checked_signum(), Some(Fix::ONE));
assert_eq!(Fix::ZERO.checked_signum(), Some(Fix::ZERO));
assert_eq!(Fix::from_num(-5).checked_signum(), Some(Fix::NEG_ONE));

type OneIntBit = FixedI16<U15>;
type ZeroIntBits = FixedI16<U16>;
assert_eq!(OneIntBit::from_num(0.5).checked_signum(), None);
assert_eq!(ZeroIntBits::from_num(0.25).checked_signum(), None);
assert_eq!(ZeroIntBits::from_num(-0.5).checked_signum(), None);
source

pub const fn checked_mul(self, rhs: FixedI16<Frac>) -> Option<FixedI16<Frac>>

Checked multiplication. Returns the product, or [None] on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::MAX.checked_mul(Fix::ONE), Some(Fix::MAX));
assert_eq!(Fix::MAX.checked_mul(Fix::from_num(2)), None);
source

pub const fn checked_div(self, rhs: FixedI16<Frac>) -> Option<FixedI16<Frac>>

Checked division. Returns the quotient, or [None] if the divisor is zero or on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::MAX.checked_div(Fix::ONE), Some(Fix::MAX));
assert_eq!(Fix::MAX.checked_div(Fix::ONE / 2), None);
source

pub const fn checked_recip(self) -> Option<FixedI16<Frac>>

Checked reciprocal. Returns the reciprocal, or [None] if self is zero or on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(2).checked_recip(), Some(Fix::from_num(0.5)));
assert_eq!(Fix::ZERO.checked_recip(), None);
source

pub const fn checked_div_euclid( self, rhs: FixedI16<Frac> ) -> Option<FixedI16<Frac>>

Checked Euclidean division. Returns the quotient, or [None] if the divisor is zero or on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(7.5).checked_div_euclid(Fix::from_num(2)), Some(Fix::from_num(3)));
assert_eq!(Fix::from_num(7.5).checked_div_euclid(Fix::ZERO), None);
assert_eq!(Fix::MAX.checked_div_euclid(Fix::from_num(0.25)), None);
assert_eq!(Fix::from_num(-7.5).checked_div_euclid(Fix::from_num(2)), Some(Fix::from_num(-4)));
source

pub const fn checked_add_prod<AFrac, BFrac>( self, a: FixedI16<AFrac>, b: FixedI16<BFrac> ) -> Option<FixedI16<Frac>>where AFrac: LeEqU16, BFrac: LeEqU16,

Adds self to the product a × b, returning [None] on overflow.

For some cases, the product a × b would overflow on its own, but the final result self + a × b is representable; in these cases this method returns the correct result without overflow.

The a and b parameters can have a fixed-point type like self but with a different number of fractional bits.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::from_num(3).checked_add_prod(Fix::from_num(4), Fix::from_num(0.5)),
    Some(Fix::from_num(5))
);
assert_eq!(Fix::DELTA.checked_add_prod(Fix::MAX, Fix::ONE), None);
// -MAX + MAX × 1.5 = MAX / 2, which does not overflow
assert_eq!(
    (-Fix::MAX).checked_add_prod(Fix::MAX, Fix::from_num(1.5)),
    Some(Fix::MAX / 2)
);
source

pub fn checked_mul_acc<AFrac, BFrac>( &mut self, a: FixedI16<AFrac>, b: FixedI16<BFrac> ) -> Option<()>where AFrac: LeEqU16, BFrac: LeEqU16,

Checked multiply and accumulate. Adds (a × b) to self, or returns [None] on overflow.

Like all other checked methods, this method wraps the successful return value in an [Option]. Since the unchecked mul_acc method does not return a value, which is equivalent to returning [()][unit], this method wraps [()][unit] into [Some]([()][unit]) on success.

When overflow occurs, self is not modified and retains its previous value.

For some cases, the product a × b would overflow on its own, but the final result self + a × b is representable; in these cases this method saves the correct result without overflow.

The a and b parameters can have a fixed-point type like self but with a different number of fractional bits.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let mut acc = Fix::from_num(3);
let check = acc.checked_mul_acc(Fix::from_num(4), Fix::from_num(0.5));
assert_eq!(check, Some(()));
assert_eq!(acc, 5);

acc = Fix::DELTA;
let check = acc.checked_mul_acc(Fix::MAX, Fix::ONE);
assert_eq!(check, None);
// acc is unchanged on error
assert_eq!(acc, Fix::DELTA);

// MAX × 1.5 - MAX = MAX / 2, which does not overflow
acc = -Fix::MAX;
let check = acc.checked_mul_acc(Fix::MAX, Fix::from_num(1.5));
assert_eq!(check, Some(()));
assert_eq!(acc, Fix::MAX / 2);
source

pub const fn checked_rem_int(self, rhs: i16) -> Option<FixedI16<Frac>>

Checked fixed-point remainder for division by an integer. Returns the remainder, or [None] if the divisor is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(3.75).checked_rem_int(2), Some(Fix::from_num(1.75)));
assert_eq!(Fix::from_num(3.75).checked_rem_int(0), None);
assert_eq!(Fix::from_num(-3.75).checked_rem_int(2), Some(Fix::from_num(-1.75)));
source

pub const fn checked_div_euclid_int(self, rhs: i16) -> Option<FixedI16<Frac>>

Checked Euclidean division by an integer. Returns the quotient, or [None] if the divisor is zero or if the division results in overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(7.5).checked_div_euclid_int(2), Some(Fix::from_num(3)));
assert_eq!(Fix::from_num(7.5).checked_div_euclid_int(0), None);
assert_eq!(Fix::MIN.checked_div_euclid_int(-1), None);
source

pub const fn checked_rem_euclid_int(self, rhs: i16) -> Option<FixedI16<Frac>>

Checked remainder for Euclidean division by an integer. Returns the remainder, or [None] if the divisor is zero or if the remainder results in overflow.

Examples
use fixed::{types::extra::U12, FixedI16};
type Fix = FixedI16<U12>;
assert_eq!(Fix::from_num(7.5).checked_rem_euclid_int(2), Some(Fix::from_num(1.5)));
assert_eq!(Fix::from_num(7.5).checked_rem_euclid_int(0), None);
assert_eq!(Fix::from_num(-7.5).checked_rem_euclid_int(2), Some(Fix::from_num(0.5)));
// -8 ≤ Fix < 8, so the answer 12.5 overflows
assert_eq!(Fix::from_num(-7.5).checked_rem_euclid_int(20), None);
source

pub const fn checked_lerp<RangeFrac>( self, start: FixedI16<RangeFrac>, end: FixedI16<RangeFrac> ) -> Option<FixedI16<RangeFrac>>

Checked linear interpolation between start and end. Returns [None] on overflow.

The interpolted value is start + self × (end − start). This is start when self = 0, end when self = 1, and linear interpolation for all other values of self. Linear extrapolation is performed if self is not in the range 0 ≤ x ≤ 1.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(0.5).checked_lerp(Fix::ZERO, Fix::MAX), Some(Fix::MAX / 2));
assert_eq!(Fix::from_num(1.5).checked_lerp(Fix::ZERO, Fix::MAX), None);
source

pub const fn saturating_signum(self) -> FixedI16<Frac>

Saturating signum. Returns a number representing the sign of self, saturating on overflow.

Overflow can only occur

  • if the value is positive and the fixed-point number has zero or one integer bits such that it cannot hold the value 1.
  • if the value is negative and the fixed-point number has zero integer bits, such that it cannot hold the value −1.
Examples
use fixed::{
    types::extra::{U4, U15, U16},
    FixedI16,
};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(5).saturating_signum(), 1);
assert_eq!(Fix::ZERO.saturating_signum(), 0);
assert_eq!(Fix::from_num(-5).saturating_signum(), -1);

type OneIntBit = FixedI16<U15>;
type ZeroIntBits = FixedI16<U16>;
assert_eq!(OneIntBit::from_num(0.5).saturating_signum(), OneIntBit::MAX);
assert_eq!(ZeroIntBits::from_num(0.25).saturating_signum(), ZeroIntBits::MAX);
assert_eq!(ZeroIntBits::from_num(-0.5).saturating_signum(), ZeroIntBits::MIN);
source

pub const fn saturating_mul(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Saturating multiplication. Returns the product, saturating on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(3).saturating_mul(Fix::from_num(2)), Fix::from_num(6));
assert_eq!(Fix::MAX.saturating_mul(Fix::from_num(2)), Fix::MAX);
source

pub const fn saturating_div(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Saturating division. Returns the quotient, saturating on overflow.

Panics

Panics if the divisor is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let one_half = Fix::ONE / 2;
assert_eq!(Fix::ONE.saturating_div(Fix::from_num(2)), one_half);
assert_eq!(Fix::MAX.saturating_div(one_half), Fix::MAX);
source

pub const fn saturating_recip(self) -> FixedI16<Frac>

Saturating reciprocal. Returns the reciprocal, saturating on overflow.

Panics

Panics if the fixed-point number is zero.

Examples
use fixed::{types::extra::U15, FixedI16};
// only one integer bit
type Fix = FixedI16<U15>;
assert_eq!(Fix::from_num(0.25).saturating_recip(), Fix::MAX);
assert_eq!(Fix::from_num(-0.25).saturating_recip(), Fix::MIN);
source

pub const fn saturating_div_euclid(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Saturating Euclidean division. Returns the quotient, saturating on overflow.

Panics

Panics if the divisor is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(7.5).saturating_div_euclid(Fix::from_num(2)), Fix::from_num(3));
assert_eq!(Fix::MAX.saturating_div_euclid(Fix::from_num(0.25)), Fix::MAX);
assert_eq!(Fix::from_num(-7.5).saturating_div_euclid(Fix::from_num(2)), Fix::from_num(-4));
assert_eq!(Fix::MIN.saturating_div_euclid(Fix::from_num(0.25)), Fix::MIN);
source

pub const fn saturating_div_euclid_int(self, rhs: i16) -> FixedI16<Frac>

Saturating Euclidean division by an integer. Returns the quotient, saturating on overflow.

Overflow can only occur when dividing the minimum value by −1.

Panics

Panics if the divisor is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(7.5).saturating_div_euclid_int(2), Fix::from_num(3));
assert_eq!(Fix::from_num(-7.5).saturating_div_euclid_int(2), Fix::from_num(-4));
assert_eq!(Fix::MIN.saturating_div_euclid_int(-1), Fix::MAX);
source

pub const fn saturating_add_prod<AFrac, BFrac>( self, a: FixedI16<AFrac>, b: FixedI16<BFrac> ) -> FixedI16<Frac>where AFrac: LeEqU16, BFrac: LeEqU16,

Adds self to the product a × b, saturating on overflow.

For some cases, the product a × b would overflow on its own, but the final result self + a × b is representable; in these cases this method returns the correct result without overflow.

The a and b parameters can have a fixed-point type like self but with a different number of fractional bits.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::from_num(3).saturating_add_prod(Fix::from_num(4), Fix::from_num(0.5)),
    5
);
assert_eq!(Fix::ONE.saturating_add_prod(Fix::MAX, Fix::from_num(3)), Fix::MAX);
// -MAX + MAX × 1.5 = MAX / 2, which does not overflow
assert_eq!(
    (-Fix::MAX).saturating_add_prod(Fix::MAX, Fix::from_num(1.5)),
    Fix::MAX / 2
);
source

pub fn saturating_mul_acc<AFrac, BFrac>( &mut self, a: FixedI16<AFrac>, b: FixedI16<BFrac> )where AFrac: LeEqU16, BFrac: LeEqU16,

Saturating multiply and accumulate. Adds (a × b) to self, saturating on overflow.

For some cases, the product a × b would overflow on its own, but the final result self + a × b is representable; in these cases this method saves the correct result without overflow.

The a and b parameters can have a fixed-point type like self but with a different number of fractional bits.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let mut acc = Fix::from_num(3);
acc.saturating_mul_acc(Fix::from_num(4), Fix::from_num(0.5));
assert_eq!(acc, 5);

acc = Fix::MAX / 2;
acc.saturating_mul_acc(Fix::MAX / 2, Fix::from_num(3));
assert_eq!(acc, Fix::MAX);

// MAX × 1.5 - MAX = MAX / 2, which does not overflow
acc = -Fix::MAX;
acc.saturating_mul_acc(Fix::MAX, Fix::from_num(1.5));
assert_eq!(acc, Fix::MAX / 2);
source

pub const fn saturating_rem_euclid_int(self, rhs: i16) -> FixedI16<Frac>

Saturating remainder for Euclidean division by an integer. Returns the remainder, saturating on overflow.

Panics

Panics if the divisor is zero.

Examples
use fixed::{types::extra::U12, FixedI16};
type Fix = FixedI16<U12>;
assert_eq!(Fix::from_num(7.5).saturating_rem_euclid_int(2), Fix::from_num(1.5));
assert_eq!(Fix::from_num(-7.5).saturating_rem_euclid_int(2), Fix::from_num(0.5));
// -8 ≤ Fix < 8, so the answer 12.5 saturates
assert_eq!(Fix::from_num(-7.5).saturating_rem_euclid_int(20), Fix::MAX);
source

pub const fn saturating_lerp<RangeFrac>( self, start: FixedI16<RangeFrac>, end: FixedI16<RangeFrac> ) -> FixedI16<RangeFrac>

Linear interpolation between start and end, saturating on overflow.

The interpolated value is start + self × (end − start). This is start when self = 0, end when self = 1, and linear interpolation for all other values of self. Linear extrapolation is performed if self is not in the range 0 ≤ x ≤ 1.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(0.5).saturating_lerp(Fix::ZERO, Fix::MAX), Fix::MAX / 2);
assert_eq!(Fix::from_num(1.5).saturating_lerp(Fix::ZERO, Fix::MAX), Fix::MAX);
assert_eq!(Fix::from_num(-2.0).saturating_lerp(Fix::ZERO, Fix::MAX), Fix::MIN);
assert_eq!(Fix::from_num(3.0).saturating_lerp(Fix::MAX, Fix::ZERO), Fix::MIN);
source

pub const fn wrapping_signum(self) -> FixedI16<Frac>

Wrapping signum. Returns a number representing the sign of self, wrapping on overflow.

Overflow can only occur

  • if the value is positive and the fixed-point number has zero or one integer bits such that it cannot hold the value 1.
  • if the value is negative and the fixed-point number has zero integer bits, such that it cannot hold the value −1.
Examples
use fixed::{
    types::extra::{U4, U15, U16},
    FixedI16,
};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(5).wrapping_signum(), 1);
assert_eq!(Fix::ZERO.wrapping_signum(), 0);
assert_eq!(Fix::from_num(-5).wrapping_signum(), -1);

type OneIntBit = FixedI16<U15>;
type ZeroIntBits = FixedI16<U16>;
assert_eq!(OneIntBit::from_num(0.5).wrapping_signum(), -1);
assert_eq!(ZeroIntBits::from_num(0.25).wrapping_signum(), 0);
assert_eq!(ZeroIntBits::from_num(-0.5).wrapping_signum(), 0);
source

pub const fn wrapping_mul(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Wrapping multiplication. Returns the product, wrapping on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(3).wrapping_mul(Fix::from_num(2)), Fix::from_num(6));
let wrapped = Fix::from_bits(!0 << 2);
assert_eq!(Fix::MAX.wrapping_mul(Fix::from_num(4)), wrapped);
source

pub const fn wrapping_div(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Wrapping division. Returns the quotient, wrapping on overflow.

Panics

Panics if the divisor is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let one_point_5 = Fix::from_bits(0b11 << (4 - 1));
assert_eq!(Fix::from_num(3).wrapping_div(Fix::from_num(2)), one_point_5);
let quarter = Fix::ONE / 4;
let wrapped = Fix::from_bits(!0 << 2);
assert_eq!(Fix::MAX.wrapping_div(quarter), wrapped);
source

pub const fn wrapping_recip(self) -> FixedI16<Frac>

Wrapping reciprocal. Returns the reciprocal, wrapping on overflow.

Panics

Panics if the fixed-point number is zero.

Examples
use fixed::{types::extra::U15, FixedI16};
// only one integer bit
type Fix = FixedI16<U15>;
assert_eq!(Fix::from_num(0.25).wrapping_recip(), Fix::ZERO);
source

pub const fn wrapping_div_euclid(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Wrapping Euclidean division. Returns the quotient, wrapping on overflow.

Panics

Panics if the divisor is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(7.5).wrapping_div_euclid(Fix::from_num(2)), Fix::from_num(3));
let wrapped = Fix::MAX.wrapping_mul_int(4).round_to_zero();
assert_eq!(Fix::MAX.wrapping_div_euclid(Fix::from_num(0.25)), wrapped);
source

pub const fn wrapping_div_euclid_int(self, rhs: i16) -> FixedI16<Frac>

Wrapping Euclidean division by an integer. Returns the quotient, wrapping on overflow.

Overflow can only occur when dividing the minimum value by −1.

Panics

Panics if the divisor is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(7.5).wrapping_div_euclid_int(2), Fix::from_num(3));
assert_eq!(Fix::from_num(-7.5).wrapping_div_euclid_int(2), Fix::from_num(-4));
let wrapped = Fix::MIN.round_to_zero();
assert_eq!(Fix::MIN.wrapping_div_euclid_int(-1), wrapped);
source

pub const fn wrapping_add_prod<AFrac, BFrac>( self, a: FixedI16<AFrac>, b: FixedI16<BFrac> ) -> FixedI16<Frac>where AFrac: LeEqU16, BFrac: LeEqU16,

Adds self to the product a × b, wrapping on overflow.

The a and b parameters can have a fixed-point type like self but with a different number of fractional bits.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::from_num(3).wrapping_add_prod(Fix::from_num(4), Fix::from_num(0.5)),
    5
);
assert_eq!(
    Fix::MAX.wrapping_add_prod(Fix::MAX, Fix::from_num(3)),
    Fix::MAX.wrapping_mul_int(4)
);
source

pub fn wrapping_mul_acc<AFrac, BFrac>( &mut self, a: FixedI16<AFrac>, b: FixedI16<BFrac> )where AFrac: LeEqU16, BFrac: LeEqU16,

Wrapping multiply and accumulate. Adds (a × b) to self, wrapping on overflow.

The a and b parameters can have a fixed-point type like self but with a different number of fractional bits.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let mut acc = Fix::from_num(3);
acc.wrapping_mul_acc(Fix::from_num(4), Fix::from_num(0.5));
assert_eq!(acc, 5);

acc = Fix::MAX;
acc.wrapping_mul_acc(Fix::MAX, Fix::from_num(3));
assert_eq!(acc, Fix::MAX.wrapping_mul_int(4));
source

pub const fn wrapping_rem_euclid_int(self, rhs: i16) -> FixedI16<Frac>

Wrapping remainder for Euclidean division by an integer. Returns the remainder, wrapping on overflow.

Note that while remainder for Euclidean division cannot be negative, the wrapped value can be negative.

Panics

Panics if the divisor is zero.

Examples
use fixed::{types::extra::U12, FixedI16};
type Fix = FixedI16<U12>;
assert_eq!(Fix::from_num(7.5).wrapping_rem_euclid_int(2), Fix::from_num(1.5));
assert_eq!(Fix::from_num(-7.5).wrapping_rem_euclid_int(2), Fix::from_num(0.5));
// -8 ≤ Fix < 8, so the answer 12.5 wraps to -3.5
assert_eq!(Fix::from_num(-7.5).wrapping_rem_euclid_int(20), Fix::from_num(-3.5));
source

pub const fn wrapping_lerp<RangeFrac>( self, start: FixedI16<RangeFrac>, end: FixedI16<RangeFrac> ) -> FixedI16<RangeFrac>

Linear interpolation between start and end, wrapping on overflow.

The interpolated value is start + self × (end − start). This is start when self = 0, end when self = 1, and linear interpolation for all other values of self. Linear extrapolation is performed if self is not in the range 0 ≤ x ≤ 1.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(0.5).wrapping_lerp(Fix::ZERO, Fix::MAX), Fix::MAX / 2);
assert_eq!(
    Fix::from_num(1.5).wrapping_lerp(Fix::ZERO, Fix::MAX),
    Fix::MAX.wrapping_add(Fix::MAX / 2)
);
source

pub const fn unwrapped_signum(self) -> FixedI16<Frac>

Unwrapped signum. Returns a number representing the sign of self, panicking on overflow.

Overflow can only occur

  • if the value is positive and the fixed-point number has zero or one integer bits such that it cannot hold the value 1.
  • if the value is negative and the fixed-point number has zero integer bits, such that it cannot hold the value −1.
Panics

Panics if the result does not fit.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(5).unwrapped_signum(), 1);
assert_eq!(Fix::ZERO.unwrapped_signum(), 0);
assert_eq!(Fix::from_num(-5).unwrapped_signum(), -1);

The following panics because of overflow.

use fixed::{types::extra::U15, FixedI16};
type OneIntBit = FixedI16<U15>;
let _overflow = OneIntBit::from_num(0.5).unwrapped_signum();
source

pub const fn unwrapped_mul(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Unwrapped multiplication. Returns the product, panicking on overflow.

Panics

Panics if the result does not fit.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(3).unwrapped_mul(Fix::from_num(2)), Fix::from_num(6));

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::MAX.unwrapped_mul(Fix::from_num(4));
source

pub const fn unwrapped_div(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Unwrapped division. Returns the quotient, panicking on overflow.

Panics

Panics if the divisor is zero or if the division results in overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let one_point_5 = Fix::from_bits(0b11 << (4 - 1));
assert_eq!(Fix::from_num(3).unwrapped_div(Fix::from_num(2)), one_point_5);

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let quarter = Fix::ONE / 4;
let _overflow = Fix::MAX.unwrapped_div(quarter);
source

pub const fn unwrapped_recip(self) -> FixedI16<Frac>

Unwrapped reciprocal. Returns the reciprocal, panicking on overflow.

Panics

Panics if the fixed-point number is zero or on overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(0.25).unwrapped_recip(), Fix::from_num(4));
source

pub const fn unwrapped_div_euclid(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Unwrapped Euclidean division. Returns the quotient, panicking on overflow.

Panics

Panics if the divisor is zero or if the division results in overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(7.5).unwrapped_div_euclid(Fix::from_num(2)), Fix::from_num(3));

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::MAX.unwrapped_div_euclid(Fix::from_num(0.25));
source

pub const fn unwrapped_add_prod<AFrac, BFrac>( self, a: FixedI16<AFrac>, b: FixedI16<BFrac> ) -> FixedI16<Frac>where AFrac: LeEqU16, BFrac: LeEqU16,

Adds self to the product a × b, panicking on overflow.

For some cases, the product a × b would overflow on its own, but the final result self + a × b is representable; in these cases this method returns the correct result without overflow.

The a and b parameters can have a fixed-point type like self but with a different number of fractional bits.

Panics

Panics if the result does not fit.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::from_num(3).unwrapped_add_prod(Fix::from_num(4), Fix::from_num(0.5)),
    5
);
// -MAX + MAX × 1.5 = MAX / 2, which does not overflow
assert_eq!(
    (-Fix::MAX).unwrapped_add_prod(Fix::MAX, Fix::from_num(1.5)),
    Fix::MAX / 2
);

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::DELTA.unwrapped_add_prod(Fix::MAX, Fix::ONE);
source

pub fn unwrapped_mul_acc<AFrac, BFrac>( &mut self, a: FixedI16<AFrac>, b: FixedI16<BFrac> )where AFrac: LeEqU16, BFrac: LeEqU16,

Unwrapped multiply and accumulate. Adds (a × b) to self, panicking on overflow.

For some cases, the product a × b would overflow on its own, but the final result self + a × b is representable; in these cases this method saves the correct result without overflow.

The a and b parameters can have a fixed-point type like self but with a different number of fractional bits.

Panics

Panics if the result does not fit.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let mut acc = Fix::from_num(3);
acc.unwrapped_mul_acc(Fix::from_num(4), Fix::from_num(0.5));
assert_eq!(acc, 5);

// MAX × 1.5 - MAX = MAX / 2, which does not overflow
acc = -Fix::MAX;
acc.unwrapped_mul_acc(Fix::MAX, Fix::from_num(1.5));
assert_eq!(acc, Fix::MAX / 2);

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let mut acc = Fix::DELTA;
acc.unwrapped_mul_acc(Fix::MAX, Fix::ONE);
source

pub const fn unwrapped_rem_int(self, rhs: i16) -> FixedI16<Frac>

Unwrapped fixed-point remainder for division by an integer. Returns the remainder, panicking if the divisor is zero.

Panics

Panics if the divisor is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(3.75).unwrapped_rem_int(2), Fix::from_num(1.75));

The following panics because the divisor is zero.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _divisor_is_zero = Fix::from_num(3.75).unwrapped_rem_int(0);
source

pub const fn unwrapped_div_euclid_int(self, rhs: i16) -> FixedI16<Frac>

Unwrapped Euclidean division by an integer. Returns the quotient, panicking on overflow.

Overflow can only occur when dividing the minimum value by −1.

Panics

Panics if the divisor is zero or if the division results in overflow.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(7.5).unwrapped_div_euclid_int(2), Fix::from_num(3));
assert_eq!(Fix::from_num(-7.5).unwrapped_div_euclid_int(2), Fix::from_num(-4));

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::MIN.unwrapped_div_euclid_int(-1);
source

pub const fn unwrapped_rem_euclid_int(self, rhs: i16) -> FixedI16<Frac>

Unwrapped remainder for Euclidean division by an integer. Returns the remainder, panicking on overflow.

Note that while remainder for Euclidean division cannot be negative, the wrapped value can be negative.

Panics

Panics if the divisor is zero or if the division results in overflow.

Examples
use fixed::{types::extra::U12, FixedI16};
type Fix = FixedI16<U12>;
assert_eq!(Fix::from_num(7.5).unwrapped_rem_euclid_int(2), Fix::from_num(1.5));
assert_eq!(Fix::from_num(-7.5).unwrapped_rem_euclid_int(2), Fix::from_num(0.5));

The following panics because of overflow.

use fixed::{types::extra::U12, FixedI16};
type Fix = FixedI16<U12>;
// -8 ≤ Fix < 8, so the answer 12.5 overflows
let _overflow = Fix::from_num(-7.5).unwrapped_rem_euclid_int(20);
source

pub const fn unwrapped_lerp<RangeFrac>( self, start: FixedI16<RangeFrac>, end: FixedI16<RangeFrac> ) -> FixedI16<RangeFrac>

Linear interpolation between start and end, panicking on overflow.

The interpolated value is start + self × (end − start). This is start when self = 0, end when self = 1, and linear interpolation for all other values of self. Linear extrapolation is performed if self is not in the range 0 ≤ x ≤ 1.

Panics

Panics if the result overflows.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(0.5).unwrapped_lerp(Fix::ZERO, Fix::MAX), Fix::MAX / 2);

The following panics because of overflow.

use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let _overflow = Fix::from_num(1.5).unwrapped_lerp(Fix::ZERO, Fix::MAX);
source

pub const fn overflowing_signum(self) -> (FixedI16<Frac>, bool)

Overflowing signum.

Returns a [tuple] of the signum and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Overflow can only occur

  • if the value is positive and the fixed-point number has zero or one integer bits such that it cannot hold the value 1.
  • if the value is negative and the fixed-point number has zero integer bits, such that it cannot hold the value −1.
Examples
use fixed::{
    types::extra::{U4, U15, U16},
    FixedI16,
};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(5).overflowing_signum(), (Fix::ONE, false));
assert_eq!(Fix::ZERO.overflowing_signum(), (Fix::ZERO, false));
assert_eq!(Fix::from_num(-5).overflowing_signum(), (Fix::NEG_ONE, false));

type OneIntBit = FixedI16<U15>;
type ZeroIntBits = FixedI16<U16>;
assert_eq!(OneIntBit::from_num(0.5).overflowing_signum(), (OneIntBit::NEG_ONE, true));
assert_eq!(ZeroIntBits::from_num(0.25).overflowing_signum(), (ZeroIntBits::ZERO, true));
assert_eq!(ZeroIntBits::from_num(-0.5).overflowing_signum(), (ZeroIntBits::ZERO, true));
source

pub const fn overflowing_mul( self, rhs: FixedI16<Frac> ) -> (FixedI16<Frac>, bool)

Overflowing multiplication.

Returns a [tuple] of the product and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(3).overflowing_mul(Fix::from_num(2)), (Fix::from_num(6), false));
let wrapped = Fix::from_bits(!0 << 2);
assert_eq!(Fix::MAX.overflowing_mul(Fix::from_num(4)), (wrapped, true));
source

pub const fn overflowing_div( self, rhs: FixedI16<Frac> ) -> (FixedI16<Frac>, bool)

Overflowing division.

Returns a [tuple] of the quotient and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Panics

Panics if the divisor is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let one_point_5 = Fix::from_bits(0b11 << (4 - 1));
assert_eq!(Fix::from_num(3).overflowing_div(Fix::from_num(2)), (one_point_5, false));
let quarter = Fix::ONE / 4;
let wrapped = Fix::from_bits(!0 << 2);
assert_eq!(Fix::MAX.overflowing_div(quarter), (wrapped, true));
source

pub const fn overflowing_recip(self) -> (FixedI16<Frac>, bool)

Overflowing reciprocal.

Returns a [tuple] of the reciprocal and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Panics

Panics if the fixed-point number is zero.

Examples
use fixed::{
    types::extra::{U4, U15},
    FixedI16,
};
type Fix = FixedI16<U4>;
// only one integer bit
type Small = FixedI16<U15>;
assert_eq!(Fix::from_num(0.25).overflowing_recip(), (Fix::from_num(4), false));
assert_eq!(Small::from_num(0.25).overflowing_recip(), (Small::ZERO, true));
source

pub const fn overflowing_div_euclid( self, rhs: FixedI16<Frac> ) -> (FixedI16<Frac>, bool)

Overflowing Euclidean division.

Returns a [tuple] of the quotient and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Panics

Panics if the divisor is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let check = Fix::from_num(3);
assert_eq!(Fix::from_num(7.5).overflowing_div_euclid(Fix::from_num(2)), (check, false));
let wrapped = Fix::MAX.wrapping_mul_int(4).round_to_zero();
assert_eq!(Fix::MAX.overflowing_div_euclid(Fix::from_num(0.25)), (wrapped, true));
source

pub const fn overflowing_div_euclid_int( self, rhs: i16 ) -> (FixedI16<Frac>, bool)

Overflowing Euclidean division by an integer.

Returns a [tuple] of the quotient and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned. Overflow can only occur when dividing the minimum value by −1.

Panics

Panics if the divisor is zero.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::from_num(7.5).overflowing_div_euclid_int(2), (Fix::from_num(3), false));
assert_eq!(Fix::from_num(-7.5).overflowing_div_euclid_int(2), (Fix::from_num(-4), false));
let wrapped = Fix::MIN.round_to_zero();
assert_eq!(Fix::MIN.overflowing_div_euclid_int(-1), (wrapped, true));
source

pub const fn overflowing_add_prod<AFrac, BFrac>( self, a: FixedI16<AFrac>, b: FixedI16<BFrac> ) -> (FixedI16<Frac>, bool)where AFrac: LeEqU16, BFrac: LeEqU16,

Adds self to the product a × b.

Returns a [tuple] of the result and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

For some cases, the product a × b would overflow on its own, but the final result self + a × b is representable; in these cases this method returns the correct result without overflow.

The a and b parameters can have a fixed-point type like self but with a different number of fractional bits.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::from_num(3).overflowing_add_prod(Fix::from_num(4), Fix::from_num(0.5)),
    (Fix::from_num(5), false)
);
assert_eq!(
    Fix::MAX.overflowing_add_prod(Fix::MAX, Fix::from_num(3)),
    (Fix::MAX.wrapping_mul_int(4), true)
);
// -MAX + MAX × 1.5 = MAX / 2, which does not overflow
assert_eq!(
    (-Fix::MAX).overflowing_add_prod(Fix::MAX, Fix::from_num(1.5)),
    (Fix::MAX / 2, false)
);
source

pub fn overflowing_mul_acc<AFrac, BFrac>( &mut self, a: FixedI16<AFrac>, b: FixedI16<BFrac> ) -> boolwhere AFrac: LeEqU16, BFrac: LeEqU16,

Overflowing multiply and accumulate. Adds (a × b) to self, wrapping and returning [true] if overflow occurs.

For some cases, the product a × b would overflow on its own, but the final result self + a × b is representable; in these cases this method saves the correct result without overflow.

The a and b parameters can have a fixed-point type like self but with a different number of fractional bits.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
let mut acc = Fix::from_num(3);
assert!(!acc.overflowing_mul_acc(Fix::from_num(4), Fix::from_num(0.5)));
assert_eq!(acc, 5);

acc = Fix::MAX;
assert!(acc.overflowing_mul_acc(Fix::MAX, Fix::from_num(3)));
assert_eq!(acc, Fix::MAX.wrapping_mul_int(4));

// MAX × 1.5 - MAX = MAX / 2, which does not overflow
acc = -Fix::MAX;
assert!(!acc.overflowing_mul_acc(Fix::MAX, Fix::from_num(1.5)));
assert_eq!(acc, Fix::MAX / 2);
source

pub const fn overflowing_rem_euclid_int( self, rhs: i16 ) -> (FixedI16<Frac>, bool)

Remainder for Euclidean division by an integer.

Returns a [tuple] of the remainder and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Note that while remainder for Euclidean division cannot be negative, the wrapped value can be negative.

Panics

Panics if the divisor is zero.

Examples
use fixed::{types::extra::U12, FixedI16};
type Fix = FixedI16<U12>;
assert_eq!(Fix::from_num(7.5).overflowing_rem_euclid_int(2), (Fix::from_num(1.5), false));
assert_eq!(Fix::from_num(-7.5).overflowing_rem_euclid_int(2), (Fix::from_num(0.5), false));
// -8 ≤ Fix < 8, so the answer 12.5 wraps to -3.5
assert_eq!(Fix::from_num(-7.5).overflowing_rem_euclid_int(20), (Fix::from_num(-3.5), true));
source

pub const fn overflowing_lerp<RangeFrac>( self, start: FixedI16<RangeFrac>, end: FixedI16<RangeFrac> ) -> (FixedI16<RangeFrac>, bool)

Overflowing linear interpolation between start and end.

Returns a [tuple] of the result and a [bool] indicationg whether an overflow has occurred. On overflow, the wrapped value is returned.

The interpolated value is start + self × (end − start). This is start when self = 0, end when self = 1, and linear interpolation for all other values of self. Linear extrapolation is performed if self is not in the range 0 ≤ x ≤ 1.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(
    Fix::from_num(0.5).overflowing_lerp(Fix::ZERO, Fix::MAX),
    (Fix::MAX / 2, false)
);
assert_eq!(
    Fix::from_num(1.5).overflowing_lerp(Fix::ZERO, Fix::MAX),
    (Fix::MAX.wrapping_add(Fix::MAX / 2), true)
);
source§

impl<Frac> FixedI16<Frac>where Frac: LeEqU16,

This block contains constants in the range 0 < x < 0.5.

Examples

use fixed::{consts, types::extra::U16, FixedI16};
type Fix = FixedI16<U16>;
assert_eq!(Fix::LOG10_2, Fix::from_num(consts::LOG10_2));
source

pub const FRAC_1_TAU: FixedI16<Frac> = Self::from_const(consts::FRAC_1_TAU)

1/τ = 0.159154…

source

pub const FRAC_2_TAU: FixedI16<Frac> = Self::from_const(consts::FRAC_2_TAU)

2/τ = 0.318309…

source

pub const FRAC_PI_8: FixedI16<Frac> = Self::from_const(consts::FRAC_PI_8)

π/8 = 0.392699…

source

pub const FRAC_1_PI: FixedI16<Frac> = Self::from_const(consts::FRAC_1_PI)

1/π = 0.318309…

source

pub const LOG10_2: FixedI16<Frac> = Self::from_const(consts::LOG10_2)

log10 2 = 0.301029…

source

pub const LOG10_E: FixedI16<Frac> = Self::from_const(consts::LOG10_E)

log10 e = 0.434294…

source§

impl<Frac> FixedI16<Frac>where Frac: Unsigned + IsLessOrEqual<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, Output = B1>,

This block contains constants in the range 0.5 ≤ x < 1, and −1.

These constants are not representable in signed fixed-point numbers with less than 1 integer bit.

Examples

use fixed::{consts, types::extra::U15, FixedI16};
type Fix = FixedI16<U15>;
assert_eq!(Fix::LN_2, Fix::from_num(consts::LN_2));
assert!(0.5 <= Fix::LN_2 && Fix::LN_2 < 1);

The following example fails to compile, since the maximum representable value with 16 fractional bits and 0 integer bits is < 0.5.

use fixed::{consts, types::extra::U16, FixedI16};
type Fix = FixedI16<U16>;
let _ = Fix::LN_2;
source

pub const NEG_ONE: FixedI16<Frac> = Self::from_bits(-1 << Frac::U32)

Negative one.

Examples
use fixed::{types::extra::U15, FixedI16};
type Fix = FixedI16<U15>;
assert_eq!(Fix::NEG_ONE, Fix::from_num(-1));

The following would fail as FixedI16<U15> cannot represent 1, so there is no FixedI16::<U15>::ONE.

use fixed::{types::extra::U15, FixedI16};
const _ERROR: FixedI16<U15> = FixedI16::ONE.unwrapped_neg();
source

pub const FRAC_TAU_8: FixedI16<Frac> = Self::from_const(consts::FRAC_TAU_8)

τ/8 = 0.785398…

source

pub const FRAC_TAU_12: FixedI16<Frac> = Self::from_const(consts::FRAC_TAU_12)

τ/12 = 0.523598…

source

pub const FRAC_4_TAU: FixedI16<Frac> = Self::from_const(consts::FRAC_4_TAU)

4/τ = 0.636619…

source

pub const FRAC_PI_4: FixedI16<Frac> = Self::from_const(consts::FRAC_PI_4)

π/4 = 0.785398…

source

pub const FRAC_PI_6: FixedI16<Frac> = Self::from_const(consts::FRAC_PI_6)

π/6 = 0.523598…

source

pub const FRAC_2_PI: FixedI16<Frac> = Self::from_const(consts::FRAC_2_PI)

2/π = 0.636619…

source

pub const FRAC_1_SQRT_PI: FixedI16<Frac> = Self::from_const(consts::FRAC_1_SQRT_PI)

1/√π = 0.564189…

source

pub const FRAC_1_SQRT_2: FixedI16<Frac> = Self::from_const(consts::FRAC_1_SQRT_2)

1/√2 = 0.707106…

source

pub const FRAC_1_SQRT_3: FixedI16<Frac> = Self::from_const(consts::FRAC_1_SQRT_3)

1/√3 = 0.577350…

source

pub const LN_2: FixedI16<Frac> = Self::from_const(consts::LN_2)

ln 2 = 0.693147…

source

pub const FRAC_1_PHI: FixedI16<Frac> = Self::from_const(consts::FRAC_1_PHI)

The golden ratio conjugate, Φ = 1/φ = 0.618033…

source

pub const GAMMA: FixedI16<Frac> = Self::from_const(consts::GAMMA)

The Euler-Mascheroni constant, γ = 0.577215…

source

pub const CATALAN: FixedI16<Frac> = Self::from_const(consts::CATALAN)

Catalan’s constant = 0.915965…

source§

impl<Frac> FixedI16<Frac>where Frac: Unsigned + IsLessOrEqual<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, Output = B1>,

This block contains constants in the range 1 ≤ x < 2.

These constants are not representable in signed fixed-point numbers with less than 2 integer bits.

Examples

use fixed::{consts, types::extra::U14, FixedI16};
type Fix = FixedI16<U14>;
assert_eq!(Fix::LOG2_E, Fix::from_num(consts::LOG2_E));
assert!(1 <= Fix::LOG2_E && Fix::LOG2_E < 2);

The following example fails to compile, since the maximum representable value with 15 fractional bits and 1 integer bit is < 1.

use fixed::{consts, types::extra::U15, FixedI16};
type Fix = FixedI16<U15>;
let _ = Fix::LOG2_E;
source

pub const ONE: FixedI16<Frac> = Self::from_bits(1 << Frac::U32)

One.

Examples
use fixed::{types::extra::U4, FixedI16};
type Fix = FixedI16<U4>;
assert_eq!(Fix::ONE, Fix::from_num(1));
source

pub const FRAC_TAU_4: FixedI16<Frac> = Self::from_const(consts::FRAC_TAU_4)

τ/4 = 1.57079…

source

pub const FRAC_TAU_6: FixedI16<Frac> = Self::from_const(consts::FRAC_TAU_6)

τ/6 = 1.04719…

source

pub const FRAC_PI_2: FixedI16<Frac> = Self::from_const(consts::FRAC_PI_2)

π/2 = 1.57079…

source

pub const FRAC_PI_3: FixedI16<Frac> = Self::from_const(consts::FRAC_PI_3)

π/3 = 1.04719…

source

pub const SQRT_PI: FixedI16<Frac> = Self::from_const(consts::SQRT_PI)

√π = 1.77245…

source

pub const FRAC_2_SQRT_PI: FixedI16<Frac> = Self::from_const(consts::FRAC_2_SQRT_PI)

2/√π = 1.12837…

source

pub const SQRT_2: FixedI16<Frac> = Self::from_const(consts::SQRT_2)

√2 = 1.41421…

source

pub const SQRT_3: FixedI16<Frac> = Self::from_const(consts::SQRT_3)

√3 = 1.73205…

source

pub const SQRT_E: FixedI16<Frac> = Self::from_const(consts::SQRT_E)

√e = 1.64872…

source

pub const LOG2_E: FixedI16<Frac> = Self::from_const(consts::LOG2_E)

log2 e = 1.44269…

source

pub const PHI: FixedI16<Frac> = Self::from_const(consts::PHI)

The golden ratio, φ = 1.61803…

source

pub const SQRT_PHI: FixedI16<Frac> = Self::from_const(consts::SQRT_PHI)

√φ = 1.27201…

source§

impl<Frac> FixedI16<Frac>where Frac: Unsigned + IsLessOrEqual<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, Output = B1>,

This block contains constants in the range 2 ≤ x < 4.

These constants are not representable in signed fixed-point numbers with less than 3 integer bits.

Examples

use fixed::{consts, types::extra::U13, FixedI16};
type Fix = FixedI16<U13>;
assert_eq!(Fix::E, Fix::from_num(consts::E));
assert!(2 <= Fix::E && Fix::E < 4);

The following example fails to compile, since the maximum representable value with 14 fractional bits and 2 integer bits is < 2.

use fixed::{consts, types::extra::U14, FixedI16};
type Fix = FixedI16<U14>;
let _ = Fix::E;
source

pub const FRAC_TAU_2: FixedI16<Frac> = Self::from_const(consts::FRAC_TAU_2)

τ/2 = 3.14159…

source

pub const FRAC_TAU_3: FixedI16<Frac> = Self::from_const(consts::FRAC_TAU_3)

τ/3 = 2.09439…

source

pub const PI: FixedI16<Frac> = Self::from_const(consts::PI)

Archimedes’ constant, π = 3.14159…

source

pub const E: FixedI16<Frac> = Self::from_const(consts::E)

Euler’s number, e = 2.71828…

source

pub const LOG2_10: FixedI16<Frac> = Self::from_const(consts::LOG2_10)

log2 10 = 3.32192…

source

pub const LN_10: FixedI16<Frac> = Self::from_const(consts::LN_10)

ln 10 = 2.30258…

source§

impl<Frac> FixedI16<Frac>where Frac: Unsigned + IsLessOrEqual<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, Output = B1>,

This block contains constants in the range 4 ≤ x < 8.

These constants are not representable in signed fixed-point numbers with less than 4 integer bits.

Examples

use fixed::{consts, types::extra::U12, FixedI16};
type Fix = FixedI16<U12>;
assert_eq!(Fix::TAU, Fix::from_num(consts::TAU));
assert!(4 <= Fix::TAU && Fix::TAU < 8);

The following example fails to compile, since the maximum representable value with 13 fractional bits and 3 integer bits is < 4.

use fixed::{consts, types::extra::U13, FixedI16};
type Fix = FixedI16<U13>;
let _ = Fix::TAU;
source

pub const TAU: FixedI16<Frac> = Self::from_const(consts::TAU)

A turn, τ = 6.28318…

Trait Implementations§

source§

impl<Frac> Add<&FixedI16<Frac>> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &FixedI16<Frac>) -> FixedI16<Frac>

Performs the + operation. Read more
source§

impl<Frac> Add<&FixedI16<Frac>> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &FixedI16<Frac>) -> FixedI16<Frac>

Performs the + operation. Read more
source§

impl<Frac> Add<FixedI16<Frac>> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the + operator.
source§

fn add(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Performs the + operation. Read more
source§

impl<Frac> Add<FixedI16<Frac>> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the + operator.
source§

fn add(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Performs the + operation. Read more
source§

impl<Frac> AddAssign<&FixedI16<Frac>> for FixedI16<Frac>

source§

fn add_assign(&mut self, rhs: &FixedI16<Frac>)

Performs the += operation. Read more
source§

impl<Frac> AddAssign<FixedI16<Frac>> for FixedI16<Frac>

source§

fn add_assign(&mut self, rhs: FixedI16<Frac>)

Performs the += operation. Read more
source§

impl<Frac> Binary for FixedI16<Frac>where Frac: LeEqU16,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter.
source§

impl<Frac> BitAnd<&FixedI16<Frac>> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: &FixedI16<Frac>) -> FixedI16<Frac>

Performs the & operation. Read more
source§

impl<Frac> BitAnd<&FixedI16<Frac>> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: &FixedI16<Frac>) -> FixedI16<Frac>

Performs the & operation. Read more
source§

impl<Frac> BitAnd<FixedI16<Frac>> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Performs the & operation. Read more
source§

impl<Frac> BitAnd<FixedI16<Frac>> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Performs the & operation. Read more
source§

impl<Frac> BitAndAssign<&FixedI16<Frac>> for FixedI16<Frac>

source§

fn bitand_assign(&mut self, rhs: &FixedI16<Frac>)

Performs the &= operation. Read more
source§

impl<Frac> BitAndAssign<FixedI16<Frac>> for FixedI16<Frac>

source§

fn bitand_assign(&mut self, rhs: FixedI16<Frac>)

Performs the &= operation. Read more
source§

impl<Frac> BitOr<&FixedI16<Frac>> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: &FixedI16<Frac>) -> FixedI16<Frac>

Performs the | operation. Read more
source§

impl<Frac> BitOr<&FixedI16<Frac>> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: &FixedI16<Frac>) -> FixedI16<Frac>

Performs the | operation. Read more
source§

impl<Frac> BitOr<FixedI16<Frac>> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Performs the | operation. Read more
source§

impl<Frac> BitOr<FixedI16<Frac>> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Performs the | operation. Read more
source§

impl<Frac> BitOrAssign<&FixedI16<Frac>> for FixedI16<Frac>

source§

fn bitor_assign(&mut self, rhs: &FixedI16<Frac>)

Performs the |= operation. Read more
source§

impl<Frac> BitOrAssign<FixedI16<Frac>> for FixedI16<Frac>

source§

fn bitor_assign(&mut self, rhs: FixedI16<Frac>)

Performs the |= operation. Read more
source§

impl<Frac> BitXor<&FixedI16<Frac>> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: &FixedI16<Frac>) -> FixedI16<Frac>

Performs the ^ operation. Read more
source§

impl<Frac> BitXor<&FixedI16<Frac>> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: &FixedI16<Frac>) -> FixedI16<Frac>

Performs the ^ operation. Read more
source§

impl<Frac> BitXor<FixedI16<Frac>> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Performs the ^ operation. Read more
source§

impl<Frac> BitXor<FixedI16<Frac>> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Performs the ^ operation. Read more
source§

impl<Frac> BitXorAssign<&FixedI16<Frac>> for FixedI16<Frac>

source§

fn bitxor_assign(&mut self, rhs: &FixedI16<Frac>)

Performs the ^= operation. Read more
source§

impl<Frac> BitXorAssign<FixedI16<Frac>> for FixedI16<Frac>

source§

fn bitxor_assign(&mut self, rhs: FixedI16<Frac>)

Performs the ^= operation. Read more
source§

impl<Frac> Cast<F128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn cast(self) -> F128

Casts the value.
source§

impl<Frac> Cast<F128Bits> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn cast(self) -> F128Bits

Casts the value.
source§

impl<FracSrc, FracDst> Cast<FixedI128<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU128,

source§

fn cast(self) -> FixedI128<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> Cast<FixedI16<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU16,

source§

fn cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> Cast<FixedI16<FracDst>> for FixedI32<FracSrc>where FracSrc: LeEqU32, FracDst: LeEqU16,

source§

fn cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> Cast<FixedI16<FracDst>> for FixedI8<FracSrc>where FracSrc: LeEqU8, FracDst: LeEqU16,

source§

fn cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> Cast<FixedI16<FracDst>> for FixedU16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU16,

source§

fn cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> Cast<FixedI16<FracDst>> for FixedU32<FracSrc>where FracSrc: LeEqU32, FracDst: LeEqU16,

source§

fn cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> Cast<FixedI16<FracDst>> for FixedU8<FracSrc>where FracSrc: LeEqU8, FracDst: LeEqU16,

source§

fn cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> Cast<FixedI32<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU32,

source§

fn cast(self) -> FixedI32<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> Cast<FixedI64<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU64,

source§

fn cast(self) -> FixedI64<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> Cast<FixedI8<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU8,

source§

fn cast(self) -> FixedI8<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> Cast<FixedU128<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU128,

source§

fn cast(self) -> FixedU128<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> Cast<FixedU16<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU16,

source§

fn cast(self) -> FixedU16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> Cast<FixedU32<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU32,

source§

fn cast(self) -> FixedU32<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> Cast<FixedU64<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU64,

source§

fn cast(self) -> FixedU64<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> Cast<FixedU8<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU8,

source§

fn cast(self) -> FixedU8<FracDst>

Casts the value.
source§

impl<Frac> Cast<bf16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn cast(self) -> bf16

Casts the value.
source§

impl<Frac> Cast<f16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn cast(self) -> f16

Casts the value.
source§

impl<Frac> Cast<f32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn cast(self) -> f32

Casts the value.
source§

impl<Frac> Cast<f64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn cast(self) -> f64

Casts the value.
source§

impl<Frac> Cast<i128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn cast(self) -> i128

Casts the value.
source§

impl<Frac> Cast<i16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn cast(self) -> i16

Casts the value.
source§

impl<Frac> Cast<i32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn cast(self) -> i32

Casts the value.
source§

impl<Frac> Cast<i64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn cast(self) -> i64

Casts the value.
source§

impl<Frac> Cast<i8> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn cast(self) -> i8

Casts the value.
source§

impl<Frac> Cast<isize> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn cast(self) -> isize

Casts the value.
source§

impl<Frac> Cast<u128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn cast(self) -> u128

Casts the value.
source§

impl<Frac> Cast<u16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn cast(self) -> u16

Casts the value.
source§

impl<Frac> Cast<u32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn cast(self) -> u32

Casts the value.
source§

impl<Frac> Cast<u64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn cast(self) -> u64

Casts the value.
source§

impl<Frac> Cast<u8> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn cast(self) -> u8

Casts the value.
source§

impl<Frac> Cast<usize> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn cast(self) -> usize

Casts the value.
source§

impl<Frac> CheckedCast<F128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn checked_cast(self) -> Option<F128>

Casts the value.
source§

impl<Frac> CheckedCast<F128Bits> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn checked_cast(self) -> Option<F128Bits>

Casts the value.
source§

impl<FracSrc, FracDst> CheckedCast<FixedI128<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU128,

source§

fn checked_cast(self) -> Option<FixedI128<FracDst>>

Casts the value.
source§

impl<FracSrc, FracDst> CheckedCast<FixedI16<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU16,

source§

fn checked_cast(self) -> Option<FixedI16<FracDst>>

Casts the value.
source§

impl<FracSrc, FracDst> CheckedCast<FixedI16<FracDst>> for FixedI32<FracSrc>where FracSrc: LeEqU32, FracDst: LeEqU16,

source§

fn checked_cast(self) -> Option<FixedI16<FracDst>>

Casts the value.
source§

impl<FracSrc, FracDst> CheckedCast<FixedI16<FracDst>> for FixedI8<FracSrc>where FracSrc: LeEqU8, FracDst: LeEqU16,

source§

fn checked_cast(self) -> Option<FixedI16<FracDst>>

Casts the value.
source§

impl<FracSrc, FracDst> CheckedCast<FixedI16<FracDst>> for FixedU16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU16,

source§

fn checked_cast(self) -> Option<FixedI16<FracDst>>

Casts the value.
source§

impl<FracSrc, FracDst> CheckedCast<FixedI16<FracDst>> for FixedU32<FracSrc>where FracSrc: LeEqU32, FracDst: LeEqU16,

source§

fn checked_cast(self) -> Option<FixedI16<FracDst>>

Casts the value.
source§

impl<FracSrc, FracDst> CheckedCast<FixedI16<FracDst>> for FixedU8<FracSrc>where FracSrc: LeEqU8, FracDst: LeEqU16,

source§

fn checked_cast(self) -> Option<FixedI16<FracDst>>

Casts the value.
source§

impl<FracSrc, FracDst> CheckedCast<FixedI32<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU32,

source§

fn checked_cast(self) -> Option<FixedI32<FracDst>>

Casts the value.
source§

impl<FracSrc, FracDst> CheckedCast<FixedI64<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU64,

source§

fn checked_cast(self) -> Option<FixedI64<FracDst>>

Casts the value.
source§

impl<FracSrc, FracDst> CheckedCast<FixedI8<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU8,

source§

fn checked_cast(self) -> Option<FixedI8<FracDst>>

Casts the value.
source§

impl<FracSrc, FracDst> CheckedCast<FixedU128<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU128,

source§

fn checked_cast(self) -> Option<FixedU128<FracDst>>

Casts the value.
source§

impl<FracSrc, FracDst> CheckedCast<FixedU16<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU16,

source§

fn checked_cast(self) -> Option<FixedU16<FracDst>>

Casts the value.
source§

impl<FracSrc, FracDst> CheckedCast<FixedU32<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU32,

source§

fn checked_cast(self) -> Option<FixedU32<FracDst>>

Casts the value.
source§

impl<FracSrc, FracDst> CheckedCast<FixedU64<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU64,

source§

fn checked_cast(self) -> Option<FixedU64<FracDst>>

Casts the value.
source§

impl<FracSrc, FracDst> CheckedCast<FixedU8<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU8,

source§

fn checked_cast(self) -> Option<FixedU8<FracDst>>

Casts the value.
source§

impl<Frac> CheckedCast<bf16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn checked_cast(self) -> Option<bf16>

Casts the value.
source§

impl<Frac> CheckedCast<f16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn checked_cast(self) -> Option<f16>

Casts the value.
source§

impl<Frac> CheckedCast<f32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn checked_cast(self) -> Option<f32>

Casts the value.
source§

impl<Frac> CheckedCast<f64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn checked_cast(self) -> Option<f64>

Casts the value.
source§

impl<Frac> CheckedCast<i128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn checked_cast(self) -> Option<i128>

Casts the value.
source§

impl<Frac> CheckedCast<i16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn checked_cast(self) -> Option<i16>

Casts the value.
source§

impl<Frac> CheckedCast<i32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn checked_cast(self) -> Option<i32>

Casts the value.
source§

impl<Frac> CheckedCast<i64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn checked_cast(self) -> Option<i64>

Casts the value.
source§

impl<Frac> CheckedCast<i8> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn checked_cast(self) -> Option<i8>

Casts the value.
source§

impl<Frac> CheckedCast<isize> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn checked_cast(self) -> Option<isize>

Casts the value.
source§

impl<Frac> CheckedCast<u128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn checked_cast(self) -> Option<u128>

Casts the value.
source§

impl<Frac> CheckedCast<u16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn checked_cast(self) -> Option<u16>

Casts the value.
source§

impl<Frac> CheckedCast<u32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn checked_cast(self) -> Option<u32>

Casts the value.
source§

impl<Frac> CheckedCast<u64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn checked_cast(self) -> Option<u64>

Casts the value.
source§

impl<Frac> CheckedCast<u8> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn checked_cast(self) -> Option<u8>

Casts the value.
source§

impl<Frac> CheckedCast<usize> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn checked_cast(self) -> Option<usize>

Casts the value.
source§

impl<Frac> Clone for FixedI16<Frac>

source§

fn clone(&self) -> FixedI16<Frac>

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Frac> Contiguous for FixedI16<Frac>where Frac: 'static,

§

type Int = i16

The primitive integer type with an identical representation to this type. Read more
source§

const MAX_VALUE: i16 = 32_767i16

The upper inclusive bound for valid instances of this type.
source§

const MIN_VALUE: i16 = -32_768i16

The lower inclusive bound for valid instances of this type.
§

fn from_integer(value: Self::Int) -> Option<Self>

If value is within the range for valid instances of this type, returns Some(converted_value), otherwise, returns None. Read more
§

fn into_integer(self) -> Self::Int

Perform the conversion from C into the underlying integral type. This mostly exists otherwise generic code would need unsafe for the value as integer Read more
source§

impl<Frac> Debug for FixedI16<Frac>where Frac: LeEqU16,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<Frac> Default for FixedI16<Frac>

source§

fn default() -> FixedI16<Frac>

Returns the “default value” for a type. Read more
source§

impl<Frac> Display for FixedI16<Frac>where Frac: LeEqU16,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<Frac> Div<&FixedI16<Frac>> for &FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &FixedI16<Frac>) -> FixedI16<Frac>

Performs the / operation. Read more
source§

impl<Frac> Div<&FixedI16<Frac>> for FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &FixedI16<Frac>) -> FixedI16<Frac>

Performs the / operation. Read more
source§

impl<Frac> Div<&i16> for &FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &i16) -> FixedI16<Frac>

Performs the / operation. Read more
source§

impl<Frac> Div<&i16> for FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &i16) -> FixedI16<Frac>

Performs the / operation. Read more
source§

impl<Frac> Div<FixedI16<Frac>> for &FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the / operator.
source§

fn div(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Performs the / operation. Read more
source§

impl<Frac> Div<FixedI16<Frac>> for FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the / operator.
source§

fn div(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Performs the / operation. Read more
source§

impl<Frac> Div<i16> for &FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the / operator.
source§

fn div(self, rhs: i16) -> FixedI16<Frac>

Performs the / operation. Read more
source§

impl<Frac> Div<i16> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the / operator.
source§

fn div(self, rhs: i16) -> FixedI16<Frac>

Performs the / operation. Read more
source§

impl<Frac> DivAssign<&FixedI16<Frac>> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn div_assign(&mut self, rhs: &FixedI16<Frac>)

Performs the /= operation. Read more
source§

impl<Frac> DivAssign<&i16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn div_assign(&mut self, rhs: &i16)

Performs the /= operation. Read more
source§

impl<Frac> DivAssign<FixedI16<Frac>> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn div_assign(&mut self, rhs: FixedI16<Frac>)

Performs the /= operation. Read more
source§

impl<Frac> DivAssign<i16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn div_assign(&mut self, rhs: i16)

Performs the /= operation. Read more
source§

impl<Frac> Fixed for FixedI16<Frac>where Frac: LeEqU16,

§

type Bits = i16

The primitive integer underlying type. Read more
§

type NonZeroBits = NonZeroI16

The non-zero wrapped version of Bits. Read more
§

type Bytes = [u8; 2]

A byte array with the same size as the type. Read more
§

type Frac = Frac

The number of fractional bits as a compile-time Unsigned as provided by the typenum crate. Read more
§

type Signed = FixedI16<Frac>

An unsigned fixed-point number type with the same number of integer and fractional bits as Self. Read more
§

type Unsigned = FixedU16<Frac>

An unsigned fixed-point number type with the same number of integer and fractional bits as Self. Read more
source§

const ZERO: FixedI16<Frac> = Self::ZERO

Zero. Read more
source§

const TRY_ONE: Option<FixedI16<Frac>> = Self::TRY_ONE

One if the fixed-point number can represent it, otherwise [None].
source§

const DELTA: FixedI16<Frac> = Self::DELTA

The difference between any two successive representable numbers, Δ. Read more
source§

const MIN: FixedI16<Frac> = Self::MIN

The smallest value that can be represented. Read more
source§

const MAX: FixedI16<Frac> = Self::MAX

The largest value that can be represented. Read more
source§

const IS_SIGNED: bool = true

[true] if the type is signed. Read more
source§

const INT_NBITS: u32 = Self::INT_NBITS

The number of integer bits. Read more
source§

const FRAC_NBITS: u32 = Self::FRAC_NBITS

The number of fractional bits. Read more
source§

fn from_bits(bits: <FixedI16<Frac> as Fixed>::Bits) -> FixedI16<Frac>

Creates a fixed-point number that has a bitwise representation identical to the given integer. Read more
source§

fn to_bits(self) -> <FixedI16<Frac> as Fixed>::Bits

Creates an integer that has a bitwise representation identical to the given fixed-point number. Read more
source§

fn from_be(fixed: FixedI16<Frac>) -> FixedI16<Frac>

Converts a fixed-point number from big endian to the target’s endianness. Read more
source§

fn from_le(fixed: FixedI16<Frac>) -> FixedI16<Frac>

Converts a fixed-point number from little endian to the target’s endianness. Read more
source§

fn to_be(self) -> FixedI16<Frac>

Converts this fixed-point number to big endian from the target’s endianness. Read more
source§

fn to_le(self) -> FixedI16<Frac>

Converts this fixed-point number to little endian from the target’s endianness. Read more
source§

fn swap_bytes(self) -> FixedI16<Frac>

Reverses the byte order of the fixed-point number. Read more
source§

fn from_be_bytes(bits: <FixedI16<Frac> as Fixed>::Bytes) -> FixedI16<Frac>

Creates a fixed-point number from its representation as a byte array in big endian. Read more
source§

fn from_le_bytes(bits: <FixedI16<Frac> as Fixed>::Bytes) -> FixedI16<Frac>

Creates a fixed-point number from its representation as a byte array in little endian. Read more
source§

fn from_ne_bytes(bits: <FixedI16<Frac> as Fixed>::Bytes) -> FixedI16<Frac>

Creates a fixed-point number from its representation as a byte array in native endian. Read more
source§

fn to_be_bytes(self) -> <FixedI16<Frac> as Fixed>::Bytes

Returns the memory representation of this fixed-point number as a byte array in big-endian byte order. Read more
source§

fn to_le_bytes(self) -> <FixedI16<Frac> as Fixed>::Bytes

Returns the memory representation of this fixed-point number as a byte array in little-endian byte order. Read more
source§

fn to_ne_bytes(self) -> <FixedI16<Frac> as Fixed>::Bytes

Returns the memory representation of this fixed-point number as a byte array in native byte order. Read more
source§

fn from_num<Src>(src: Src) -> FixedI16<Frac>where Src: ToFixed,

Creates a fixed-point number from another number. Read more
source§

fn to_num<Dst>(self) -> Dstwhere Dst: FromFixed,

Converts a fixed-point number to another number. Read more
source§

fn checked_from_num<Src>(val: Src) -> Option<FixedI16<Frac>>where Src: ToFixed,

Creates a fixed-point number from another number if it fits, otherwise returns [None]. Read more
source§

fn checked_to_num<Dst>(self) -> Option<Dst>where Dst: FromFixed,

Converts a fixed-point number to another number if it fits, otherwise returns [None]. Read more
source§

fn saturating_from_num<Src>(val: Src) -> FixedI16<Frac>where Src: ToFixed,

Creates a fixed-point number from another number, saturating the value if it does not fit. Read more
source§

fn saturating_to_num<Dst>(self) -> Dstwhere Dst: FromFixed,

Converts a fixed-point number to another number, saturating the value if it does not fit. Read more
source§

fn wrapping_from_num<Src>(val: Src) -> FixedI16<Frac>where Src: ToFixed,

Creates a fixed-point number from another number, wrapping the value on overflow. Read more
source§

fn wrapping_to_num<Dst>(self) -> Dstwhere Dst: FromFixed,

Converts a fixed-point number to another number, wrapping the value on overflow. Read more
source§

fn unwrapped_from_num<Src>(val: Src) -> FixedI16<Frac>where Src: ToFixed,

Creates a fixed-point number from another number, panicking on overflow. Read more
source§

fn unwrapped_to_num<Dst>(self) -> Dstwhere Dst: FromFixed,

Converts a fixed-point number to another number, panicking on overflow. Read more
source§

fn overflowing_from_num<Src>(val: Src) -> (FixedI16<Frac>, bool)where Src: ToFixed,

Creates a fixed-point number from another number. Read more
source§

fn overflowing_to_num<Dst>(self) -> (Dst, bool)where Dst: FromFixed,

Converts a fixed-point number to another number. Read more
source§

fn from_str_binary(src: &str) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing binary digits to return a fixed-point number. Read more
source§

fn from_str_octal(src: &str) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing octal digits to return a fixed-point number. Read more
source§

fn from_str_hex(src: &str) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing hexadecimal digits to return a fixed-point number. Read more
source§

fn saturating_from_str(src: &str) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing decimal digits to return a fixed-point number, saturating on overflow. Read more
source§

fn saturating_from_str_binary( src: &str ) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing binary digits to return a fixed-point number, saturating on overflow. Read more
source§

fn saturating_from_str_octal( src: &str ) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing octal digits to return a fixed-point number, saturating on overflow. Read more
source§

fn saturating_from_str_hex(src: &str) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing hexadecimal digits to return a fixed-point number, saturating on overflow. Read more
source§

fn wrapping_from_str(src: &str) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing decimal digits to return a fixed-point number, wrapping on overflow. Read more
source§

fn wrapping_from_str_binary( src: &str ) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing binary digits to return a fixed-point number, wrapping on overflow. Read more
source§

fn wrapping_from_str_octal(src: &str) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing octal digits to return a fixed-point number, wrapping on overflow. Read more
source§

fn wrapping_from_str_hex(src: &str) -> Result<FixedI16<Frac>, ParseFixedError>

Parses a string slice containing hexadecimal digits to return a fixed-point number, wrapping on overflow. Read more
source§

fn unwrapped_from_str(src: &str) -> FixedI16<Frac>

Parses a string slice containing decimal digits to return a fixed-point number, panicking on overflow. Read more
source§

fn unwrapped_from_str_binary(src: &str) -> FixedI16<Frac>

Parses a string slice containing binary digits to return a fixed-point number, panicking on overflow. Read more
source§

fn unwrapped_from_str_octal(src: &str) -> FixedI16<Frac>

Parses a string slice containing octal digits to return a fixed-point number, panicking on overflow. Read more
source§

fn unwrapped_from_str_hex(src: &str) -> FixedI16<Frac>

Parses a string slice containing hexadecimal digits to return a fixed-point number, panicking on overflow. Read more
source§

fn overflowing_from_str( src: &str ) -> Result<(FixedI16<Frac>, bool), ParseFixedError>

Parses a string slice containing decimal digits to return a fixed-point number. Read more
source§

fn overflowing_from_str_binary( src: &str ) -> Result<(FixedI16<Frac>, bool), ParseFixedError>

Parses a string slice containing binary digits to return a fixed-point number. Read more
source§

fn overflowing_from_str_octal( src: &str ) -> Result<(FixedI16<Frac>, bool), ParseFixedError>

Parses a string slice containing octal digits to return a fixed-point number. Read more
source§

fn overflowing_from_str_hex( src: &str ) -> Result<(FixedI16<Frac>, bool), ParseFixedError>

Parses a string slice containing hexadecimal digits to return a fixed-point number. Read more
source§

fn int(self) -> FixedI16<Frac>

Returns the integer part. Read more
source§

fn frac(self) -> FixedI16<Frac>

Returns the fractional part. Read more
source§

fn ceil(self) -> FixedI16<Frac>

Rounds to the next integer towards +∞. Read more
source§

fn floor(self) -> FixedI16<Frac>

Rounds to the next integer towards −∞. Read more
source§

fn round_to_zero(self) -> FixedI16<Frac>

Rounds to the next integer towards 0. Read more
source§

fn round(self) -> FixedI16<Frac>

Rounds to the nearest integer, with ties rounded away from zero. Read more
source§

fn round_ties_to_even(self) -> FixedI16<Frac>

Rounds to the nearest integer, with ties rounded to even. Read more
source§

fn checked_ceil(self) -> Option<FixedI16<Frac>>

Checked ceil. Rounds to the next integer towards +∞, returning [None] on overflow. Read more
source§

fn checked_floor(self) -> Option<FixedI16<Frac>>

Checked floor. Rounds to the next integer towards −∞, returning [None] on overflow. Read more
source§

fn checked_round(self) -> Option<FixedI16<Frac>>

Checked round. Rounds to the nearest integer, with ties rounded away from zero, returning [None] on overflow. Read more
source§

fn checked_round_ties_to_even(self) -> Option<FixedI16<Frac>>

Checked round. Rounds to the nearest integer, with ties rounded to even, returning [None] on overflow. Read more
source§

fn saturating_ceil(self) -> FixedI16<Frac>

Saturating ceil. Rounds to the next integer towards +∞, saturating on overflow. Read more
source§

fn saturating_floor(self) -> FixedI16<Frac>

Saturating floor. Rounds to the next integer towards −∞, saturating on overflow. Read more
source§

fn saturating_round(self) -> FixedI16<Frac>

Saturating round. Rounds to the nearest integer, with ties rounded away from zero, and saturating on overflow. Read more
source§

fn saturating_round_ties_to_even(self) -> FixedI16<Frac>

Saturating round. Rounds to the nearest integer, with ties rounded to_even, and saturating on overflow. Read more
source§

fn wrapping_ceil(self) -> FixedI16<Frac>

Wrapping ceil. Rounds to the next integer towards +∞, wrapping on overflow. Read more
source§

fn wrapping_floor(self) -> FixedI16<Frac>

Wrapping floor. Rounds to the next integer towards −∞, wrapping on overflow. Read more
source§

fn wrapping_round(self) -> FixedI16<Frac>

Wrapping round. Rounds to the next integer to the nearest, with ties rounded away from zero, and wrapping on overflow. Read more
source§

fn wrapping_round_ties_to_even(self) -> FixedI16<Frac>

Wrapping round. Rounds to the next integer to the nearest, with ties rounded to even, and wrapping on overflow. Read more
source§

fn unwrapped_ceil(self) -> FixedI16<Frac>

Unwrapped ceil. Rounds to the next integer towards +∞, panicking on overflow. Read more
source§

fn unwrapped_floor(self) -> FixedI16<Frac>

Unwrapped floor. Rounds to the next integer towards −∞, panicking on overflow. Read more
source§

fn unwrapped_round(self) -> FixedI16<Frac>

Unwrapped round. Rounds to the next integer to the nearest, with ties rounded away from zero, and panicking on overflow. Read more
source§

fn unwrapped_round_ties_to_even(self) -> FixedI16<Frac>

Unwrapped round. Rounds to the next integer to the nearest, with ties rounded to even, and panicking on overflow. Read more
source§

fn overflowing_ceil(self) -> (FixedI16<Frac>, bool)

Overflowing ceil. Rounds to the next integer towards +∞. Read more
source§

fn overflowing_floor(self) -> (FixedI16<Frac>, bool)

Overflowing floor. Rounds to the next integer towards −∞. Read more
source§

fn overflowing_round(self) -> (FixedI16<Frac>, bool)

Overflowing round. Rounds to the next integer to the nearest, with ties rounded away from zero. Read more
source§

fn overflowing_round_ties_to_even(self) -> (FixedI16<Frac>, bool)

Overflowing round. Rounds to the next integer to the nearest, with ties rounded to even. Read more
source§

fn count_ones(self) -> u32

Returns the number of ones in the binary representation. Read more
source§

fn count_zeros(self) -> u32

Returns the number of zeros in the binary representation. Read more
source§

fn leading_ones(self) -> u32

Returns the number of leading ones in the binary representation. Read more
source§

fn leading_zeros(self) -> u32

Returns the number of leading zeros in the binary representation. Read more
source§

fn trailing_ones(self) -> u32

Returns the number of trailing ones in the binary representation. Read more
source§

fn trailing_zeros(self) -> u32

Returns the number of trailing zeros in the binary representation. Read more
source§

fn int_log2(self) -> i32

Integer base-2 logarithm, rounded down. Read more
source§

fn int_log10(self) -> i32

Integer base-10 logarithm, rounded down. Read more
source§

fn int_log(self, base: u32) -> i32

Integer logarithm to the specified base, rounded down. Read more
source§

fn checked_int_log2(self) -> Option<i32>

Checked integer base-2 logarithm, rounded down. Returns the logarithm or [None] if the fixed-point number is ≤ 0. Read more
source§

fn checked_int_log10(self) -> Option<i32>

Checked integer base-10 logarithm, rounded down. Returns the logarithm or [None] if the fixed-point number is ≤ 0. Read more
source§

fn checked_int_log(self, base: u32) -> Option<i32>

Checked integer logarithm to the specified base, rounded down. Returns the logarithm, or [None] if the fixed-point number is ≤ 0 or if the base is < 2. Read more
source§

fn reverse_bits(self) -> FixedI16<Frac>

Reverses the order of the bits of the fixed-point number. Read more
source§

fn rotate_left(self, n: u32) -> FixedI16<Frac>

Shifts to the left by n bits, wrapping the truncated bits to the right end. Read more
source§

fn rotate_right(self, n: u32) -> FixedI16<Frac>

Shifts to the right by n bits, wrapping the truncated bits to the left end. Read more
source§

fn is_zero(self) -> bool

Returns [true] if the number is zero. Read more
source§

fn dist(self, other: FixedI16<Frac>) -> FixedI16<Frac>

Returns the distance from self to other. Read more
source§

fn abs_diff(self, other: FixedI16<Frac>) -> <FixedI16<Frac> as Fixed>::Unsigned

Returns the absolute value of the difference between self and other using an unsigned type without any wrapping or panicking. Read more
source§

fn mean(self, other: FixedI16<Frac>) -> FixedI16<Frac>

Returns the mean of self and other. Read more
source§

fn recip(self) -> FixedI16<Frac>

Returns the reciprocal. Read more
source§

fn next_multiple_of(self, other: FixedI16<Frac>) -> FixedI16<Frac>

Returns the next multiple of other. Read more
source§

fn mul_add(self, mul: FixedI16<Frac>, add: FixedI16<Frac>) -> FixedI16<Frac>

Multiply and add. Returns self × mul + add. Read more
source§

fn add_prod(self, a: FixedI16<Frac>, b: FixedI16<Frac>) -> FixedI16<Frac>

Adds self to the product a × b. Read more
source§

fn mul_acc(&mut self, a: FixedI16<Frac>, b: FixedI16<Frac>)

Multiply and accumulate. Adds (a × b) to self. Read more
source§

fn div_euclid(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Euclidean division by an integer. Read more
source§

fn rem_euclid(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Remainder for Euclidean division. Read more
source§

fn div_euclid_int(self, rhs: <FixedI16<Frac> as Fixed>::Bits) -> FixedI16<Frac>

Euclidean division by an integer. Read more
source§

fn rem_euclid_int(self, rhs: <FixedI16<Frac> as Fixed>::Bits) -> FixedI16<Frac>

Remainder for Euclidean division by an integer. Read more
source§

fn lerp(self, start: FixedI16<Frac>, end: FixedI16<Frac>) -> FixedI16<Frac>

Linear interpolation between start and end. Read more
source§

fn inv_lerp(self, start: FixedI16<Frac>, end: FixedI16<Frac>) -> FixedI16<Frac>

Inverse linear interpolation between start and end. Read more
source§

fn checked_neg(self) -> Option<FixedI16<Frac>>

Checked negation. Returns the negated value, or [None] on overflow. Read more
source§

fn checked_add(self, rhs: FixedI16<Frac>) -> Option<FixedI16<Frac>>

Checked addition. Returns the sum, or [None] on overflow. Read more
source§

fn checked_sub(self, rhs: FixedI16<Frac>) -> Option<FixedI16<Frac>>

Checked subtraction. Returns the difference, or [None] on overflow. Read more
source§

fn checked_mul(self, rhs: FixedI16<Frac>) -> Option<FixedI16<Frac>>

Checked multiplication. Returns the product, or [None] on overflow. Read more
source§

fn checked_div(self, rhs: FixedI16<Frac>) -> Option<FixedI16<Frac>>

Checked division. Returns the quotient, or [None] if the divisor is zero or on overflow. Read more
source§

fn checked_rem(self, rhs: FixedI16<Frac>) -> Option<FixedI16<Frac>>

Checked remainder. Returns the remainder, or [None] if the divisor is zero. Read more
source§

fn checked_recip(self) -> Option<FixedI16<Frac>>

Checked reciprocal. Returns the reciprocal, or [None] if self is zero or on overflow. Read more
source§

fn checked_next_multiple_of( self, other: FixedI16<Frac> ) -> Option<FixedI16<Frac>>

Checked next multiple of other. Returns the next multiple, or [None] if other is zero or on overflow. Read more
source§

fn checked_mul_add( self, mul: FixedI16<Frac>, add: FixedI16<Frac> ) -> Option<FixedI16<Frac>>

Checked multiply and add. Returns self × mul + add, or [None] on overflow. Read more
source§

fn checked_add_prod( self, a: FixedI16<Frac>, b: FixedI16<Frac> ) -> Option<FixedI16<Frac>>

Adds self to the product a × b, returning [None] on overflow. Read more
source§

fn checked_mul_acc( &mut self, a: FixedI16<Frac>, b: FixedI16<Frac> ) -> Option<()>

Checked multiply and accumulate. Adds (a × b) to self, or returns [None] on overflow. Read more
source§

fn checked_div_euclid(self, rhs: FixedI16<Frac>) -> Option<FixedI16<Frac>>

Checked remainder for Euclidean division. Returns the remainder, or [None] if the divisor is zero or the division results in overflow. Read more
source§

fn checked_rem_euclid(self, rhs: FixedI16<Frac>) -> Option<FixedI16<Frac>>

Checked remainder for Euclidean division. Returns the remainder, or [None] if the divisor is zero. Read more
source§

fn checked_mul_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> Option<FixedI16<Frac>>

Checked multiplication by an integer. Returns the product, or [None] on overflow. Read more
source§

fn checked_div_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> Option<FixedI16<Frac>>

Checked division by an integer. Returns the quotient, or [None] if the divisor is zero or if the division results in overflow. Read more
source§

fn checked_rem_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> Option<FixedI16<Frac>>

Checked fixed-point remainder for division by an integer. Returns the remainder, or [None] if the divisor is zero or if the division results in overflow. Read more
source§

fn checked_div_euclid_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> Option<FixedI16<Frac>>

Checked Euclidean division by an integer. Returns the quotient, or [None] if the divisor is zero or if the division results in overflow. Read more
source§

fn checked_rem_euclid_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> Option<FixedI16<Frac>>

Checked remainder for Euclidean division by an integer. Returns the remainder, or [None] if the divisor is zero or if the remainder results in overflow. Read more
source§

fn checked_shl(self, rhs: u32) -> Option<FixedI16<Frac>>

Checked shift left. Returns the shifted number, or [None] if rhs ≥ the number of bits. Read more
source§

fn checked_shr(self, rhs: u32) -> Option<FixedI16<Frac>>

Checked shift right. Returns the shifted number, or [None] if rhs ≥ the number of bits. Read more
source§

fn checked_dist(self, other: FixedI16<Frac>) -> Option<FixedI16<Frac>>

Checked distance. Returns the distance from self to other, or [None] on overflow. Read more
source§

fn checked_lerp( self, start: FixedI16<Frac>, end: FixedI16<Frac> ) -> Option<FixedI16<Frac>>

Checked linear interpolation between start and end. Returns [None] on overflow. Read more
source§

fn checked_inv_lerp( self, start: FixedI16<Frac>, end: FixedI16<Frac> ) -> Option<FixedI16<Frac>>

Checked inverse linear interpolation between start and end. Returns [None] when start = end or on overflow. Read more
source§

fn saturating_neg(self) -> FixedI16<Frac>

Saturated negation. Returns the negated value, saturating on overflow. Read more
source§

fn saturating_add(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Saturating addition. Returns the sum, saturating on overflow. Read more
source§

fn saturating_sub(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Saturating subtraction. Returns the difference, saturating on overflow. Read more
source§

fn saturating_mul(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Saturating multiplication. Returns the product, saturating on overflow. Read more
source§

fn saturating_div(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Saturating division. Returns the quotient, saturating on overflow. Read more
source§

fn saturating_recip(self) -> FixedI16<Frac>

Saturating reciprocal. Read more
source§

fn saturating_next_multiple_of(self, other: FixedI16<Frac>) -> FixedI16<Frac>

Saturating next multiple of other. Read more
source§

fn saturating_mul_add( self, mul: FixedI16<Frac>, add: FixedI16<Frac> ) -> FixedI16<Frac>

Saturating multiply and add. Returns self × mul + add, saturating on overflow. Read more
source§

fn saturating_add_prod( self, a: FixedI16<Frac>, b: FixedI16<Frac> ) -> FixedI16<Frac>

Adds self to the product a × b, saturating on overflow. Read more
source§

fn saturating_mul_acc(&mut self, a: FixedI16<Frac>, b: FixedI16<Frac>)

Saturating multiply and add. Adds (a × b) to self, saturating on overflow. Read more
source§

fn saturating_div_euclid(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Saturating Euclidean division. Returns the quotient, saturating on overflow. Read more
source§

fn saturating_mul_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> FixedI16<Frac>

Saturating multiplication by an integer. Returns the product, saturating on overflow. Read more
source§

fn saturating_div_euclid_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> FixedI16<Frac>

Saturating Euclidean division by an integer. Returns the quotient, saturating on overflow. Read more
source§

fn saturating_rem_euclid_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> FixedI16<Frac>

Saturating remainder for Euclidean division by an integer. Returns the remainder, saturating on overflow. Read more
source§

fn saturating_dist(self, other: FixedI16<Frac>) -> FixedI16<Frac>

Saturating distance. Returns the distance from self to other, saturating on overflow. Read more
source§

fn saturating_lerp( self, start: FixedI16<Frac>, end: FixedI16<Frac> ) -> FixedI16<Frac>

Linear interpolation between start and end, saturating on overflow. Read more
source§

fn saturating_inv_lerp( self, start: FixedI16<Frac>, end: FixedI16<Frac> ) -> FixedI16<Frac>

Inverse linear interpolation between start and end, saturating on overflow. Read more
source§

fn wrapping_neg(self) -> FixedI16<Frac>

Wrapping negation. Returns the negated value, wrapping on overflow. Read more
source§

fn wrapping_add(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Wrapping addition. Returns the sum, wrapping on overflow. Read more
source§

fn wrapping_sub(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Wrapping subtraction. Returns the difference, wrapping on overflow. Read more
source§

fn wrapping_mul(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Wrapping multiplication. Returns the product, wrapping on overflow. Read more
source§

fn wrapping_div(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Wrapping division. Returns the quotient, wrapping on overflow. Read more
source§

fn wrapping_recip(self) -> FixedI16<Frac>

Wrapping reciprocal. Read more
source§

fn wrapping_next_multiple_of(self, other: FixedI16<Frac>) -> FixedI16<Frac>

Wrapping next multiple of other. Read more
source§

fn wrapping_mul_add( self, mul: FixedI16<Frac>, add: FixedI16<Frac> ) -> FixedI16<Frac>

Wrapping multiply and add. Returns self × mul + add, wrapping on overflow. Read more
source§

fn wrapping_add_prod( self, a: FixedI16<Frac>, b: FixedI16<Frac> ) -> FixedI16<Frac>

Adds self to the product a × b, wrapping on overflow. Read more
source§

fn wrapping_mul_acc(&mut self, a: FixedI16<Frac>, b: FixedI16<Frac>)

Wrapping multiply and accumulate. Adds (a × b) to self, wrapping on overflow. Read more
source§

fn wrapping_div_euclid(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Wrapping Euclidean division. Returns the quotient, wrapping on overflow. Read more
source§

fn wrapping_mul_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> FixedI16<Frac>

Wrapping multiplication by an integer. Returns the product, wrapping on overflow. Read more
source§

fn wrapping_div_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> FixedI16<Frac>

Wrapping division by an integer. Returns the quotient, wrapping on overflow. Read more
source§

fn wrapping_div_euclid_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> FixedI16<Frac>

Wrapping Euclidean division by an integer. Returns the quotient, wrapping on overflow. Read more
source§

fn wrapping_rem_euclid_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> FixedI16<Frac>

Wrapping remainder for Euclidean division by an integer. Returns the remainder, wrapping on overflow. Read more
source§

fn wrapping_shl(self, rhs: u32) -> FixedI16<Frac>

Wrapping shift left. Wraps rhs if rhs ≥ the number of bits, then shifts and returns the number. Read more
source§

fn wrapping_shr(self, rhs: u32) -> FixedI16<Frac>

Wrapping shift right. Wraps rhs if rhs ≥ the number of bits, then shifts and returns the number. Read more
source§

fn wrapping_dist(self, other: FixedI16<Frac>) -> FixedI16<Frac>

Wrapping distance. Returns the distance from self to other, wrapping on overflow. Read more
source§

fn wrapping_lerp( self, start: FixedI16<Frac>, end: FixedI16<Frac> ) -> FixedI16<Frac>

Linear interpolation between start and end, wrapping on overflow. Read more
source§

fn wrapping_inv_lerp( self, start: FixedI16<Frac>, end: FixedI16<Frac> ) -> FixedI16<Frac>

Inverse linear interpolation between start and end, wrapping on overflow. Read more
source§

fn unwrapped_neg(self) -> FixedI16<Frac>

Unwrapped negation. Returns the negated value, panicking on overflow. Read more
source§

fn unwrapped_add(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Unwrapped addition. Returns the sum, panicking on overflow. Read more
source§

fn unwrapped_sub(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Unwrapped subtraction. Returns the difference, panicking on overflow. Read more
source§

fn unwrapped_mul(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Unwrapped multiplication. Returns the product, panicking on overflow. Read more
source§

fn unwrapped_div(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Unwrapped division. Returns the quotient, panicking on overflow. Read more
source§

fn unwrapped_rem(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Unwrapped remainder. Returns the quotient, panicking if the divisor is zero. Read more
source§

fn unwrapped_recip(self) -> FixedI16<Frac>

Unwrapped reciprocal. Returns reciprocal, panicking on overflow. Read more
source§

fn unwrapped_next_multiple_of(self, other: FixedI16<Frac>) -> FixedI16<Frac>

Unwrapped next multiple of other. Returns the next multiple, panicking on overflow. Read more
source§

fn unwrapped_mul_add( self, mul: FixedI16<Frac>, add: FixedI16<Frac> ) -> FixedI16<Frac>

Unwrapped multiply and add. Returns self × mul + add, panicking on overflow. Read more
source§

fn unwrapped_add_prod( self, a: FixedI16<Frac>, b: FixedI16<Frac> ) -> FixedI16<Frac>

Adds self to the product a × b, panicking on overflow. Read more
source§

fn unwrapped_mul_acc(&mut self, a: FixedI16<Frac>, b: FixedI16<Frac>)

Unwrapped multiply and accumulate. Adds (a × b) to self, panicking on overflow. Read more
source§

fn unwrapped_div_euclid(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Unwrapped Euclidean division. Returns the quotient, panicking on overflow. Read more
source§

fn unwrapped_rem_euclid(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Unwrapped remainder for Euclidean division. Returns the remainder, panicking if the divisor is zero. Read more
source§

fn unwrapped_mul_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> FixedI16<Frac>

Unwrapped multiplication by an integer. Returns the product, panicking on overflow. Read more
source§

fn unwrapped_div_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> FixedI16<Frac>

Unwrapped division by an integer. Returns the quotient, panicking on overflow. Read more
source§

fn unwrapped_rem_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> FixedI16<Frac>

Unwrapped remainder for division by an integer. Returns the remainder, panicking if the divisor is zero. Read more
source§

fn unwrapped_div_euclid_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> FixedI16<Frac>

Unwrapped Euclidean division by an integer. Returns the quotient, panicking on overflow. Read more
source§

fn unwrapped_rem_euclid_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> FixedI16<Frac>

Unwrapped remainder for Euclidean division by an integer. Returns the remainder, panicking on overflow. Read more
source§

fn unwrapped_shl(self, rhs: u32) -> FixedI16<Frac>

Unwrapped shift left. Panics if rhs ≥ the number of bits. Read more
source§

fn unwrapped_shr(self, rhs: u32) -> FixedI16<Frac>

Unwrapped shift right. Panics if rhs ≥ the number of bits. Read more
source§

fn unwrapped_dist(self, other: FixedI16<Frac>) -> FixedI16<Frac>

Unwrapped distance. Returns the distance from self to other, panicking on overflow. Read more
source§

fn unwrapped_lerp( self, start: FixedI16<Frac>, end: FixedI16<Frac> ) -> FixedI16<Frac>

Linear interpolation between start and end, panicking on overflow. Read more
source§

fn unwrapped_inv_lerp( self, start: FixedI16<Frac>, end: FixedI16<Frac> ) -> FixedI16<Frac>

Inverse linear interpolation between start and end, panicking on overflow. Read more
source§

fn overflowing_neg(self) -> (FixedI16<Frac>, bool)

Overflowing negation. Read more
source§

fn overflowing_add(self, rhs: FixedI16<Frac>) -> (FixedI16<Frac>, bool)

Overflowing addition. Read more
source§

fn overflowing_sub(self, rhs: FixedI16<Frac>) -> (FixedI16<Frac>, bool)

Overflowing subtraction. Read more
source§

fn overflowing_mul(self, rhs: FixedI16<Frac>) -> (FixedI16<Frac>, bool)

Overflowing multiplication. Read more
source§

fn overflowing_div(self, rhs: FixedI16<Frac>) -> (FixedI16<Frac>, bool)

Overflowing division. Read more
source§

fn overflowing_recip(self) -> (FixedI16<Frac>, bool)

Overflowing reciprocal. Read more
source§

fn overflowing_next_multiple_of( self, other: FixedI16<Frac> ) -> (FixedI16<Frac>, bool)

Overflowing next multiple of other. Read more
source§

fn overflowing_mul_add( self, mul: FixedI16<Frac>, add: FixedI16<Frac> ) -> (FixedI16<Frac>, bool)

Overflowing multiply and add. Read more
source§

fn overflowing_add_prod( self, a: FixedI16<Frac>, b: FixedI16<Frac> ) -> (FixedI16<Frac>, bool)

Adds self to the product a × b. Read more
source§

fn overflowing_mul_acc(&mut self, a: FixedI16<Frac>, b: FixedI16<Frac>) -> bool

Overflowing multiply and accumulate. Adds (a × b) to self, wrapping and returning [true] if overflow occurs. Read more
source§

fn overflowing_div_euclid(self, rhs: FixedI16<Frac>) -> (FixedI16<Frac>, bool)

Overflowing Euclidean division. Read more
source§

fn overflowing_mul_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> (FixedI16<Frac>, bool)

Overflowing multiplication by an integer. Read more
source§

fn overflowing_div_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> (FixedI16<Frac>, bool)

Overflowing division by an integer. Read more
source§

fn overflowing_div_euclid_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> (FixedI16<Frac>, bool)

Overflowing Euclidean division by an integer. Read more
source§

fn overflowing_rem_euclid_int( self, rhs: <FixedI16<Frac> as Fixed>::Bits ) -> (FixedI16<Frac>, bool)

Overflowing remainder for Euclidean division by an integer. Read more
source§

fn overflowing_shl(self, rhs: u32) -> (FixedI16<Frac>, bool)

Overflowing shift left. Read more
source§

fn overflowing_shr(self, rhs: u32) -> (FixedI16<Frac>, bool)

Overflowing shift right. Read more
source§

fn overflowing_dist(self, other: FixedI16<Frac>) -> (FixedI16<Frac>, bool)

Overflowing distance. Read more
source§

fn overflowing_lerp( self, start: FixedI16<Frac>, end: FixedI16<Frac> ) -> (FixedI16<Frac>, bool)

Overflowing linear interpolation between start and end. Read more
source§

fn overflowing_inv_lerp( self, start: FixedI16<Frac>, end: FixedI16<Frac> ) -> (FixedI16<Frac>, bool)

Overflowing inverse linear interpolation between start and end. Read more
source§

fn get_signed(&self) -> Option<&Self::Signed>

Returns a reference to self as FixedSigned if the type is signed, or [None] if it is unsigned. Read more
source§

fn get_unsigned(&self) -> Option<&Self::Unsigned>

Returns a reference to self as FixedUnsigned if the type is unsigned, or [None] if it is signed. Read more
source§

fn get_signed_mut(&mut self) -> Option<&mut Self::Signed>

Returns a mutable reference to self as FixedSigned if the type is signed, or [None] if it is unsigned. Read more
source§

fn get_unsigned_mut(&mut self) -> Option<&mut Self::Unsigned>

Returns a mutable reference to self as FixedUnsigned if the type is unsigned, or [None] if it is signed. Read more
source§

impl<Frac> FixedSigned for FixedI16<Frac>where Frac: LeEqU16,

source§

const TRY_NEG_ONE: Option<FixedI16<Frac>> = Self::TRY_NEG_ONE

Negative one if the fixed-point number can represent it, otherwise [None].
source§

fn signed_bits(self) -> u32

Returns the number of bits required to represent the value. Read more
source§

fn is_positive(self) -> bool

Returns [true] if the number is > 0. Read more
source§

fn is_negative(self) -> bool

Returns [true] if the number is < 0. Read more
source§

fn abs(self) -> FixedI16<Frac>

Returns the absolute value. Read more
source§

fn unsigned_abs(self) -> <FixedI16<Frac> as Fixed>::Unsigned

Returns the absolute value using an unsigned type without any wrapping or panicking. Read more
source§

fn unsigned_dist( self, other: FixedI16<Frac> ) -> <FixedI16<Frac> as Fixed>::Unsigned

Returns the distance from self to other using an unsigned type without any wrapping or panicking. Read more
source§

fn signum(self) -> FixedI16<Frac>

Returns a number representing the sign of self. Read more
source§

fn add_unsigned( self, rhs: <FixedI16<Frac> as Fixed>::Unsigned ) -> FixedI16<Frac>

Addition with an unsigned fixed-point number. Read more
source§

fn sub_unsigned( self, rhs: <FixedI16<Frac> as Fixed>::Unsigned ) -> FixedI16<Frac>

Subtraction with an unsigned fixed-point number. Read more
source§

fn checked_abs(self) -> Option<FixedI16<Frac>>

Checked absolute value. Returns the absolute value, or [None] on overflow. Read more
source§

fn checked_signum(self) -> Option<FixedI16<Frac>>

Checked signum. Returns a number representing the sign of self, or [None] on overflow. Read more
source§

fn checked_add_unsigned( self, rhs: <FixedI16<Frac> as Fixed>::Unsigned ) -> Option<FixedI16<Frac>>

Checked addition with an unsigned fixed-point number. Returns the sum, or [None] on overflow. Read more
source§

fn checked_sub_unsigned( self, rhs: <FixedI16<Frac> as Fixed>::Unsigned ) -> Option<FixedI16<Frac>>

Checked subtraction with an unsigned fixed-point number. Returns the difference, or [None] on overflow. Read more
source§

fn saturating_abs(self) -> FixedI16<Frac>

Saturating absolute value. Returns the absolute value, saturating on overflow. Read more
source§

fn saturating_signum(self) -> FixedI16<Frac>

Saturating signum. Returns a number representing the sign of self, saturating on overflow. Read more
source§

fn saturating_add_unsigned( self, rhs: <FixedI16<Frac> as Fixed>::Unsigned ) -> FixedI16<Frac>

Saturating addition with an unsigned fixed-point number. Returns the sum, saturating on overflow. Read more
source§

fn saturating_sub_unsigned( self, rhs: <FixedI16<Frac> as Fixed>::Unsigned ) -> FixedI16<Frac>

Saturating subtraction with an unsigned fixed-point number. Returns the difference, saturating on overflow. Read more
source§

fn wrapping_abs(self) -> FixedI16<Frac>

Wrapping absolute value. Returns the absolute value, wrapping on overflow. Read more
source§

fn wrapping_signum(self) -> FixedI16<Frac>

Wrapping signum. Returns a number representing the sign of self, wrapping on overflow. Read more
source§

fn wrapping_add_unsigned( self, rhs: <FixedI16<Frac> as Fixed>::Unsigned ) -> FixedI16<Frac>

Wrapping addition with an unsigned fixed-point number. Returns the sum, wrapping on overflow. Read more
source§

fn wrapping_sub_unsigned( self, rhs: <FixedI16<Frac> as Fixed>::Unsigned ) -> FixedI16<Frac>

Wrapping subtraction with an unsigned fixed-point number. Returns the difference, wrapping on overflow. Read more
source§

fn unwrapped_abs(self) -> FixedI16<Frac>

Unwrapped absolute value. Returns the absolute value, panicking on overflow. Read more
source§

fn unwrapped_signum(self) -> FixedI16<Frac>

Unwrapped signum. Returns a number representing the sign of self, panicking on overflow. Read more
source§

fn unwrapped_add_unsigned( self, rhs: <FixedI16<Frac> as Fixed>::Unsigned ) -> FixedI16<Frac>

Unwrapped addition with an unsigned fixed-point number. Returns the sum, panicking on overflow. Read more
source§

fn unwrapped_sub_unsigned( self, rhs: <FixedI16<Frac> as Fixed>::Unsigned ) -> FixedI16<Frac>

Unwrapped subtraction with an unsigned fixed-point number. Returns the difference, panicking on overflow. Read more
source§

fn overflowing_abs(self) -> (FixedI16<Frac>, bool)

Overflowing absolute value. Read more
source§

fn overflowing_signum(self) -> (FixedI16<Frac>, bool)

Overflowing signum. Read more
source§

fn overflowing_add_unsigned( self, rhs: <FixedI16<Frac> as Fixed>::Unsigned ) -> (FixedI16<Frac>, bool)

Overflowing addition with an unsigned fixed-point number. Read more
source§

fn overflowing_sub_unsigned( self, rhs: <FixedI16<Frac> as Fixed>::Unsigned ) -> (FixedI16<Frac>, bool)

Overflowing subtraction with an unsigned fixed-point number. Read more
source§

impl<FracSrc, FracDst> From<FixedI16<FracSrc>> for FixedI32<FracDst>where FracSrc: LeEqU16<Output = B1> + IsLessOrEqual<FracDst>, FracDst: LeEqU32, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>: Sub<FracSrc>, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>: Sub<FracDst>, <UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0> as Sub<FracSrc>>::Output: IsLessOrEqual<<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0> as Sub<FracDst>>::Output, Output = B1>,

source§

fn from(src: FixedI16<FracSrc>) -> FixedI32<FracDst>

Converts a fixed-pint number.

This conversion never fails (infallible) and does not lose any precision (lossless).

source§

impl<FracSrc, FracDst> From<FixedI8<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU8<Output = B1> + IsLessOrEqual<FracDst>, FracDst: LeEqU16, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>: Sub<FracSrc>, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>: Sub<FracDst>, <UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0> as Sub<FracSrc>>::Output: IsLessOrEqual<<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0> as Sub<FracDst>>::Output, Output = B1>,

source§

fn from(src: FixedI8<FracSrc>) -> FixedI16<FracDst>

Converts a fixed-pint number.

This conversion never fails (infallible) and does not lose any precision (lossless).

source§

impl<FracSrc, FracDst> From<FixedU8<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU8<Output = B1> + IsLessOrEqual<FracDst>, FracDst: LeEqU16, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>: Sub<FracSrc>, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>: Sub<FracDst>, <UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0> as Sub<FracSrc>>::Output: IsLessOrEqual<<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1> as Sub<FracDst>>::Output, Output = B1>,

source§

fn from(src: FixedU8<FracSrc>) -> FixedI16<FracDst>

Converts a fixed-pint number.

This conversion never fails (infallible) and does not lose any precision (lossless).

source§

impl<FracDst> From<bool> for FixedI16<FracDst>where FracDst: LeEqU16, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>: Sub<FracDst>, UInt<UTerm, B1>: IsLessOrEqual<<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1> as Sub<FracDst>>::Output, Output = B1>,

source§

fn from(src: bool) -> FixedI16<FracDst>

Converts a [bool] to a fixed-point number.

This conversion never fails (infallible) and cannot lose any fractional bits (lossless).

source§

impl From<i16> for FixedI16<UTerm>

source§

fn from(src: i16) -> FixedI16<UTerm>

Converts an integer to a fixed-point number.

This conversion never fails (infallible) and cannot lose any fractional bits (lossless).

source§

impl<FracDst> From<i8> for FixedI16<FracDst>where FracDst: LeEqU16, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>: Sub<FracDst>, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>: IsLessOrEqual<<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0> as Sub<FracDst>>::Output, Output = B1>,

source§

fn from(src: i8) -> FixedI16<FracDst>

Converts an integer to a fixed-point number.

This conversion never fails (infallible) and cannot lose any fractional bits, so it is actually lossless.

source§

impl<FracDst> From<u8> for FixedI16<FracDst>where FracDst: LeEqU16, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>: Sub<FracDst>, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>: IsLessOrEqual<<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1> as Sub<FracDst>>::Output, Output = B1>,

source§

fn from(src: u8) -> FixedI16<FracDst>

Converts an integer to a fixed-point number.

This conversion never fails (infallible) and cannot lose any fractional bits, so it is actually lossless.

source§

impl<Frac> FromFixed for FixedI16<Frac>where Frac: LeEqU16,

source§

fn from_fixed<F>(src: F) -> FixedI16<Frac>where F: Fixed,

Converts a fixed-point number.

Any extra fractional bits are discarded, which rounds towards −∞.

Panics

When debug assertions are enabled, panics if the value does not fit. When debug assertions are not enabled, the wrapped value can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_from_fixed instead.

source§

fn checked_from_fixed<F>(src: F) -> Option<FixedI16<Frac>>where F: Fixed,

Converts a fixed-point number if it fits, otherwise returns [None].

Any extra fractional bits are discarded, which rounds towards −∞.

source§

fn saturating_from_fixed<F>(src: F) -> FixedI16<Frac>where F: Fixed,

Converts a fixed-point number, saturating if it does not fit.

Any extra fractional bits are discarded, which rounds towards −∞.

source§

fn wrapping_from_fixed<F>(src: F) -> FixedI16<Frac>where F: Fixed,

Converts a fixed-point number, wrapping if it does not fit.

Any extra fractional bits are discarded, which rounds towards −∞.

source§

fn overflowing_from_fixed<F>(src: F) -> (FixedI16<Frac>, bool)where F: Fixed,

Converts a fixed-point number.

Returns a [tuple] of the value and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Any extra fractional bits are discarded, which rounds towards −∞.

source§

fn unwrapped_from_fixed<F>(src: F) -> FixedI16<Frac>where F: Fixed,

Converts a fixed-point number, panicking if it does not fit.

Any extra fractional bits are discarded, which rounds towards −∞.

Panics

Panics if the value does not fit, even when debug assertions are not enabled.

source§

impl<Frac> FromStr for FixedI16<Frac>where Frac: LeEqU16,

source§

fn from_str(s: &str) -> Result<FixedI16<Frac>, <FixedI16<Frac> as FromStr>::Err>

Parses a string slice to return a fixed-point number.

Rounding is to the nearest, with ties rounded to even.

§

type Err = ParseFixedError

The associated error which can be returned from parsing.
source§

impl<Frac> Hash for FixedI16<Frac>

source§

fn hash<H>(&self, state: &mut H)where H: Hasher,

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl<FracSrc, FracDst> LosslessTryFrom<FixedI128<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU128<Output = B1> + IsLessOrEqual<FracDst>, FracDst: LeEqU16,

source§

fn lossless_try_from(src: FixedI128<FracSrc>) -> Option<FixedI16<FracDst>>

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

source§

impl<FracSrc, FracDst> LosslessTryFrom<FixedI16<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU16<Output = B1> + IsLessOrEqual<FracDst>, FracDst: LeEqU16,

source§

fn lossless_try_from(src: FixedI16<FracSrc>) -> Option<FixedI16<FracDst>>

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

source§

impl<FracSrc, FracDst> LosslessTryFrom<FixedI16<FracSrc>> for FixedI32<FracDst>where FracSrc: LeEqU16<Output = B1> + IsLessOrEqual<FracDst>, FracDst: LeEqU32,

source§

fn lossless_try_from(src: FixedI16<FracSrc>) -> Option<FixedI32<FracDst>>

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

source§

impl<FracSrc, FracDst> LosslessTryFrom<FixedI16<FracSrc>> for FixedI8<FracDst>where FracSrc: LeEqU16<Output = B1> + IsLessOrEqual<FracDst>, FracDst: LeEqU8,

source§

fn lossless_try_from(src: FixedI16<FracSrc>) -> Option<FixedI8<FracDst>>

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

source§

impl<FracSrc, FracDst> LosslessTryFrom<FixedI16<FracSrc>> for FixedU16<FracDst>where FracSrc: LeEqU16<Output = B1> + IsLessOrEqual<FracDst>, FracDst: LeEqU16,

source§

fn lossless_try_from(src: FixedI16<FracSrc>) -> Option<FixedU16<FracDst>>

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

source§

impl<FracSrc, FracDst> LosslessTryFrom<FixedI16<FracSrc>> for FixedU32<FracDst>where FracSrc: LeEqU16<Output = B1> + IsLessOrEqual<FracDst>, FracDst: LeEqU32,

source§

fn lossless_try_from(src: FixedI16<FracSrc>) -> Option<FixedU32<FracDst>>

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

source§

impl<FracSrc, FracDst> LosslessTryFrom<FixedI16<FracSrc>> for FixedU8<FracDst>where FracSrc: LeEqU16<Output = B1> + IsLessOrEqual<FracDst>, FracDst: LeEqU8,

source§

fn lossless_try_from(src: FixedI16<FracSrc>) -> Option<FixedU8<FracDst>>

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

source§

impl<FracSrc, FracDst> LosslessTryFrom<FixedI32<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU32<Output = B1> + IsLessOrEqual<FracDst>, FracDst: LeEqU16,

source§

fn lossless_try_from(src: FixedI32<FracSrc>) -> Option<FixedI16<FracDst>>

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

source§

impl<FracSrc, FracDst> LosslessTryFrom<FixedI64<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU64<Output = B1> + IsLessOrEqual<FracDst>, FracDst: LeEqU16,

source§

fn lossless_try_from(src: FixedI64<FracSrc>) -> Option<FixedI16<FracDst>>

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

source§

impl<FracSrc, FracDst> LosslessTryFrom<FixedI8<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU8<Output = B1> + IsLessOrEqual<FracDst>, FracDst: LeEqU16,

source§

fn lossless_try_from(src: FixedI8<FracSrc>) -> Option<FixedI16<FracDst>>

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

source§

impl<FracSrc, FracDst> LosslessTryFrom<FixedU128<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU128<Output = B1> + IsLessOrEqual<FracDst>, FracDst: LeEqU16,

source§

fn lossless_try_from(src: FixedU128<FracSrc>) -> Option<FixedI16<FracDst>>

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

source§

impl<FracSrc, FracDst> LosslessTryFrom<FixedU16<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU16<Output = B1> + IsLessOrEqual<FracDst>, FracDst: LeEqU16,

source§

fn lossless_try_from(src: FixedU16<FracSrc>) -> Option<FixedI16<FracDst>>

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

source§

impl<FracSrc, FracDst> LosslessTryFrom<FixedU32<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU32<Output = B1> + IsLessOrEqual<FracDst>, FracDst: LeEqU16,

source§

fn lossless_try_from(src: FixedU32<FracSrc>) -> Option<FixedI16<FracDst>>

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

source§

impl<FracSrc, FracDst> LosslessTryFrom<FixedU64<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU64<Output = B1> + IsLessOrEqual<FracDst>, FracDst: LeEqU16,

source§

fn lossless_try_from(src: FixedU64<FracSrc>) -> Option<FixedI16<FracDst>>

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

source§

impl<FracSrc, FracDst> LosslessTryFrom<FixedU8<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU8<Output = B1> + IsLessOrEqual<FracDst>, FracDst: LeEqU16,

source§

fn lossless_try_from(src: FixedU8<FracSrc>) -> Option<FixedI16<FracDst>>

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

source§

impl<Frac> LosslessTryFrom<bool> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn lossless_try_from(src: bool) -> Option<FixedI16<Frac>>

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

source§

impl<Frac> LosslessTryFrom<i128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn lossless_try_from(src: i128) -> Option<FixedI16<Frac>>

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

source§

impl<Frac> LosslessTryFrom<i16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn lossless_try_from(src: i16) -> Option<FixedI16<Frac>>

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

source§

impl<Frac> LosslessTryFrom<i32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn lossless_try_from(src: i32) -> Option<FixedI16<Frac>>

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

source§

impl<Frac> LosslessTryFrom<i64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn lossless_try_from(src: i64) -> Option<FixedI16<Frac>>

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

source§

impl<Frac> LosslessTryFrom<i8> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn lossless_try_from(src: i8) -> Option<FixedI16<Frac>>

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

source§

impl<Frac> LosslessTryFrom<isize> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn lossless_try_from(src: isize) -> Option<FixedI16<Frac>>

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

source§

impl<Frac> LosslessTryFrom<u128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn lossless_try_from(src: u128) -> Option<FixedI16<Frac>>

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

source§

impl<Frac> LosslessTryFrom<u16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn lossless_try_from(src: u16) -> Option<FixedI16<Frac>>

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

source§

impl<Frac> LosslessTryFrom<u32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn lossless_try_from(src: u32) -> Option<FixedI16<Frac>>

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

source§

impl<Frac> LosslessTryFrom<u64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn lossless_try_from(src: u64) -> Option<FixedI16<Frac>>

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

source§

impl<Frac> LosslessTryFrom<u8> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn lossless_try_from(src: u8) -> Option<FixedI16<Frac>>

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

source§

impl<Frac> LosslessTryFrom<usize> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn lossless_try_from(src: usize) -> Option<FixedI16<Frac>>

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

source§

impl<FracSrc, FracDst> LossyFrom<FixedI128<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU128, FracDst: LeEqU16, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>: Sub<FracSrc>, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>: Sub<FracDst>, <UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0> as Sub<FracSrc>>::Output: IsLessOrEqual<<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0> as Sub<FracDst>>::Output, Output = B1>,

source§

fn lossy_from(src: FixedI128<FracSrc>) -> FixedI16<FracDst>

Converts a fixed-pint number.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source that cannot be represented in the destination are discarded, which rounds towards −∞.

source§

impl<FracSrc, FracDst> LossyFrom<FixedI16<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU16, FracDst: LeEqU16, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>: Sub<FracSrc> + Sub<FracDst>, <UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0> as Sub<FracSrc>>::Output: IsLessOrEqual<<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0> as Sub<FracDst>>::Output, Output = B1>,

source§

fn lossy_from(src: FixedI16<FracSrc>) -> FixedI16<FracDst>

Converts a fixed-pint number.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source that cannot be represented in the destination are discarded, which rounds towards −∞.

source§

impl<FracSrc, FracDst> LossyFrom<FixedI16<FracSrc>> for FixedI32<FracDst>where FracSrc: LeEqU16, FracDst: LeEqU32, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>: Sub<FracSrc>, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>: Sub<FracDst>, <UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0> as Sub<FracSrc>>::Output: IsLessOrEqual<<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0> as Sub<FracDst>>::Output, Output = B1>,

source§

fn lossy_from(src: FixedI16<FracSrc>) -> FixedI32<FracDst>

Converts a fixed-pint number.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source that cannot be represented in the destination are discarded, which rounds towards −∞.

source§

impl<FracSrc, FracDst> LossyFrom<FixedI16<FracSrc>> for FixedI8<FracDst>where FracSrc: LeEqU16, FracDst: LeEqU8, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>: Sub<FracSrc>, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>: Sub<FracDst>, <UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0> as Sub<FracSrc>>::Output: IsLessOrEqual<<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0> as Sub<FracDst>>::Output, Output = B1>,

source§

fn lossy_from(src: FixedI16<FracSrc>) -> FixedI8<FracDst>

Converts a fixed-pint number.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source that cannot be represented in the destination are discarded, which rounds towards −∞.

source§

impl<FracSrc, FracDst> LossyFrom<FixedI32<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU32, FracDst: LeEqU16, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>: Sub<FracSrc>, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>: Sub<FracDst>, <UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0> as Sub<FracSrc>>::Output: IsLessOrEqual<<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0> as Sub<FracDst>>::Output, Output = B1>,

source§

fn lossy_from(src: FixedI32<FracSrc>) -> FixedI16<FracDst>

Converts a fixed-pint number.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source that cannot be represented in the destination are discarded, which rounds towards −∞.

source§

impl<FracSrc, FracDst> LossyFrom<FixedI64<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU64, FracDst: LeEqU16, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>: Sub<FracSrc>, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>: Sub<FracDst>, <UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0> as Sub<FracSrc>>::Output: IsLessOrEqual<<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0> as Sub<FracDst>>::Output, Output = B1>,

source§

fn lossy_from(src: FixedI64<FracSrc>) -> FixedI16<FracDst>

Converts a fixed-pint number.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source that cannot be represented in the destination are discarded, which rounds towards −∞.

source§

impl<FracSrc, FracDst> LossyFrom<FixedI8<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU8, FracDst: LeEqU16, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>: Sub<FracSrc>, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>: Sub<FracDst>, <UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0> as Sub<FracSrc>>::Output: IsLessOrEqual<<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0> as Sub<FracDst>>::Output, Output = B1>,

source§

fn lossy_from(src: FixedI8<FracSrc>) -> FixedI16<FracDst>

Converts a fixed-pint number.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source that cannot be represented in the destination are discarded, which rounds towards −∞.

source§

impl<FracSrc, FracDst> LossyFrom<FixedU128<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU128, FracDst: LeEqU16, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>: Sub<FracSrc>, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>: Sub<FracDst>, <UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0> as Sub<FracSrc>>::Output: IsLessOrEqual<<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1> as Sub<FracDst>>::Output, Output = B1>,

source§

fn lossy_from(src: FixedU128<FracSrc>) -> FixedI16<FracDst>

Converts a fixed-pint number.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source that cannot be represented in the destination are discarded, which rounds towards −∞.

source§

impl<FracSrc, FracDst> LossyFrom<FixedU16<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU16, FracDst: LeEqU16, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>: Sub<FracSrc>, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>: Sub<FracDst>, <UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0> as Sub<FracSrc>>::Output: IsLessOrEqual<<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1> as Sub<FracDst>>::Output, Output = B1>,

source§

fn lossy_from(src: FixedU16<FracSrc>) -> FixedI16<FracDst>

Converts a fixed-pint number.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source that cannot be represented in the destination are discarded, which rounds towards −∞.

source§

impl<FracSrc, FracDst> LossyFrom<FixedU32<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU32, FracDst: LeEqU16, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>: Sub<FracSrc>, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>: Sub<FracDst>, <UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0> as Sub<FracSrc>>::Output: IsLessOrEqual<<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1> as Sub<FracDst>>::Output, Output = B1>,

source§

fn lossy_from(src: FixedU32<FracSrc>) -> FixedI16<FracDst>

Converts a fixed-pint number.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source that cannot be represented in the destination are discarded, which rounds towards −∞.

source§

impl<FracSrc, FracDst> LossyFrom<FixedU64<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU64, FracDst: LeEqU16, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>: Sub<FracSrc>, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>: Sub<FracDst>, <UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0> as Sub<FracSrc>>::Output: IsLessOrEqual<<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1> as Sub<FracDst>>::Output, Output = B1>,

source§

fn lossy_from(src: FixedU64<FracSrc>) -> FixedI16<FracDst>

Converts a fixed-pint number.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source that cannot be represented in the destination are discarded, which rounds towards −∞.

source§

impl<FracSrc, FracDst> LossyFrom<FixedU8<FracSrc>> for FixedI16<FracDst>where FracSrc: LeEqU8, FracDst: LeEqU16, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>: Sub<FracSrc>, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>: Sub<FracDst>, <UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0> as Sub<FracSrc>>::Output: IsLessOrEqual<<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1> as Sub<FracDst>>::Output, Output = B1>,

source§

fn lossy_from(src: FixedU8<FracSrc>) -> FixedI16<FracDst>

Converts a fixed-pint number.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source that cannot be represented in the destination are discarded, which rounds towards −∞.

source§

impl<FracDst> LossyFrom<bool> for FixedI16<FracDst>where FracDst: LeEqU16, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>: Sub<FracDst>, UInt<UTerm, B1>: IsLessOrEqual<<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1> as Sub<FracDst>>::Output, Output = B1>,

source§

fn lossy_from(src: bool) -> FixedI16<FracDst>

Converts a [bool] to a fixed-point number.

This conversion never fails (infallible) and cannot lose any fractional bits, so it is actually lossless.

source§

impl LossyFrom<i16> for FixedI16<UTerm>

source§

fn lossy_from(src: i16) -> FixedI16<UTerm>

Converts an integer to a fixed-point number.

This conversion never fails (infallible) and actually does not lose any precision (lossless).

source§

impl<FracDst> LossyFrom<i8> for FixedI16<FracDst>where FracDst: LeEqU16, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>: Sub<FracDst>, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>: IsLessOrEqual<<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0> as Sub<FracDst>>::Output, Output = B1>,

source§

fn lossy_from(src: i8) -> FixedI16<FracDst>

Converts an integer to a fixed-point number.

This conversion never fails (infallible) and cannot lose any fractional bits, so it is actually lossless.

source§

impl<FracDst> LossyFrom<u8> for FixedI16<FracDst>where FracDst: LeEqU16, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>: Sub<FracDst>, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>: IsLessOrEqual<<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1> as Sub<FracDst>>::Output, Output = B1>,

source§

fn lossy_from(src: u8) -> FixedI16<FracDst>

Converts an integer to a fixed-point number.

This conversion never fails (infallible) and cannot lose any fractional bits, so it is actually lossless.

source§

impl<Frac> LowerHex for FixedI16<Frac>where Frac: LeEqU16,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter.
source§

impl<Frac> Mul<&FixedI16<Frac>> for &FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &FixedI16<Frac>) -> FixedI16<Frac>

Performs the * operation. Read more
source§

impl<Frac> Mul<&FixedI16<Frac>> for FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &FixedI16<Frac>) -> FixedI16<Frac>

Performs the * operation. Read more
source§

impl<Frac> Mul<&i16> for &FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &i16) -> FixedI16<Frac>

Performs the * operation. Read more
source§

impl<Frac> Mul<&i16> for FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &i16) -> FixedI16<Frac>

Performs the * operation. Read more
source§

impl<Frac> Mul<FixedI16<Frac>> for &FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Performs the * operation. Read more
source§

impl<Frac> Mul<FixedI16<Frac>> for FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Performs the * operation. Read more
source§

impl<Frac> Mul<i16> for &FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: i16) -> FixedI16<Frac>

Performs the * operation. Read more
source§

impl<Frac> Mul<i16> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: i16) -> FixedI16<Frac>

Performs the * operation. Read more
source§

impl<Frac, RhsFrac> MulAssign<&FixedI16<RhsFrac>> for FixedI16<Frac>where RhsFrac: LeEqU16,

source§

fn mul_assign(&mut self, rhs: &FixedI16<RhsFrac>)

Performs the *= operation. Read more
source§

impl<Frac> MulAssign<&i16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn mul_assign(&mut self, rhs: &i16)

Performs the *= operation. Read more
source§

impl<Frac, RhsFrac> MulAssign<FixedI16<RhsFrac>> for FixedI16<Frac>where RhsFrac: LeEqU16,

source§

fn mul_assign(&mut self, rhs: FixedI16<RhsFrac>)

Performs the *= operation. Read more
source§

impl<Frac> MulAssign<i16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn mul_assign(&mut self, rhs: i16)

Performs the *= operation. Read more
source§

impl<Frac> Neg for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the - operator.
source§

fn neg(self) -> FixedI16<Frac>

Performs the unary - operation. Read more
source§

impl<Frac> Neg for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the - operator.
source§

fn neg(self) -> FixedI16<Frac>

Performs the unary - operation. Read more
source§

impl<Frac> Not for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the ! operator.
source§

fn not(self) -> FixedI16<Frac>

Performs the unary ! operation. Read more
source§

impl<Frac> Not for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the ! operator.
source§

fn not(self) -> FixedI16<Frac>

Performs the unary ! operation. Read more
source§

impl<Frac> Octal for FixedI16<Frac>where Frac: LeEqU16,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter.
source§

impl<Frac> Ord for FixedI16<Frac>where Frac: LeEqU16,

source§

fn cmp(&self, rhs: &FixedI16<Frac>) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<Frac> OverflowingCast<F128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn overflowing_cast(self) -> (F128, bool)

Casts the value.
source§

impl<Frac> OverflowingCast<F128Bits> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn overflowing_cast(self) -> (F128Bits, bool)

Casts the value.
source§

impl<FracSrc, FracDst> OverflowingCast<FixedI128<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU128,

source§

fn overflowing_cast(self) -> (FixedI128<FracDst>, bool)

Casts the value.
source§

impl<FracSrc, FracDst> OverflowingCast<FixedI16<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU16,

source§

fn overflowing_cast(self) -> (FixedI16<FracDst>, bool)

Casts the value.
source§

impl<FracSrc, FracDst> OverflowingCast<FixedI16<FracDst>> for FixedI32<FracSrc>where FracSrc: LeEqU32, FracDst: LeEqU16,

source§

fn overflowing_cast(self) -> (FixedI16<FracDst>, bool)

Casts the value.
source§

impl<FracSrc, FracDst> OverflowingCast<FixedI16<FracDst>> for FixedI8<FracSrc>where FracSrc: LeEqU8, FracDst: LeEqU16,

source§

fn overflowing_cast(self) -> (FixedI16<FracDst>, bool)

Casts the value.
source§

impl<FracSrc, FracDst> OverflowingCast<FixedI16<FracDst>> for FixedU16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU16,

source§

fn overflowing_cast(self) -> (FixedI16<FracDst>, bool)

Casts the value.
source§

impl<FracSrc, FracDst> OverflowingCast<FixedI16<FracDst>> for FixedU32<FracSrc>where FracSrc: LeEqU32, FracDst: LeEqU16,

source§

fn overflowing_cast(self) -> (FixedI16<FracDst>, bool)

Casts the value.
source§

impl<FracSrc, FracDst> OverflowingCast<FixedI16<FracDst>> for FixedU8<FracSrc>where FracSrc: LeEqU8, FracDst: LeEqU16,

source§

fn overflowing_cast(self) -> (FixedI16<FracDst>, bool)

Casts the value.
source§

impl<FracSrc, FracDst> OverflowingCast<FixedI32<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU32,

source§

fn overflowing_cast(self) -> (FixedI32<FracDst>, bool)

Casts the value.
source§

impl<FracSrc, FracDst> OverflowingCast<FixedI64<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU64,

source§

fn overflowing_cast(self) -> (FixedI64<FracDst>, bool)

Casts the value.
source§

impl<FracSrc, FracDst> OverflowingCast<FixedI8<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU8,

source§

fn overflowing_cast(self) -> (FixedI8<FracDst>, bool)

Casts the value.
source§

impl<FracSrc, FracDst> OverflowingCast<FixedU128<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU128,

source§

fn overflowing_cast(self) -> (FixedU128<FracDst>, bool)

Casts the value.
source§

impl<FracSrc, FracDst> OverflowingCast<FixedU16<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU16,

source§

fn overflowing_cast(self) -> (FixedU16<FracDst>, bool)

Casts the value.
source§

impl<FracSrc, FracDst> OverflowingCast<FixedU32<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU32,

source§

fn overflowing_cast(self) -> (FixedU32<FracDst>, bool)

Casts the value.
source§

impl<FracSrc, FracDst> OverflowingCast<FixedU64<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU64,

source§

fn overflowing_cast(self) -> (FixedU64<FracDst>, bool)

Casts the value.
source§

impl<FracSrc, FracDst> OverflowingCast<FixedU8<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU8,

source§

fn overflowing_cast(self) -> (FixedU8<FracDst>, bool)

Casts the value.
source§

impl<Frac> OverflowingCast<bf16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn overflowing_cast(self) -> (bf16, bool)

Casts the value.
source§

impl<Frac> OverflowingCast<f16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn overflowing_cast(self) -> (f16, bool)

Casts the value.
source§

impl<Frac> OverflowingCast<f32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn overflowing_cast(self) -> (f32, bool)

Casts the value.
source§

impl<Frac> OverflowingCast<f64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn overflowing_cast(self) -> (f64, bool)

Casts the value.
source§

impl<Frac> OverflowingCast<i128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn overflowing_cast(self) -> (i128, bool)

Casts the value.
source§

impl<Frac> OverflowingCast<i16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn overflowing_cast(self) -> (i16, bool)

Casts the value.
source§

impl<Frac> OverflowingCast<i32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn overflowing_cast(self) -> (i32, bool)

Casts the value.
source§

impl<Frac> OverflowingCast<i64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn overflowing_cast(self) -> (i64, bool)

Casts the value.
source§

impl<Frac> OverflowingCast<i8> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn overflowing_cast(self) -> (i8, bool)

Casts the value.
source§

impl<Frac> OverflowingCast<isize> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn overflowing_cast(self) -> (isize, bool)

Casts the value.
source§

impl<Frac> OverflowingCast<u128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn overflowing_cast(self) -> (u128, bool)

Casts the value.
source§

impl<Frac> OverflowingCast<u16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn overflowing_cast(self) -> (u16, bool)

Casts the value.
source§

impl<Frac> OverflowingCast<u32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn overflowing_cast(self) -> (u32, bool)

Casts the value.
source§

impl<Frac> OverflowingCast<u64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn overflowing_cast(self) -> (u64, bool)

Casts the value.
source§

impl<Frac> OverflowingCast<u8> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn overflowing_cast(self) -> (u8, bool)

Casts the value.
source§

impl<Frac> OverflowingCast<usize> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn overflowing_cast(self) -> (usize, bool)

Casts the value.
source§

impl<Frac> PartialEq<F128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn eq(&self, rhs: &F128) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Frac> PartialEq<F128Bits> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn eq(&self, rhs: &F128Bits) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<FracLhs, FracRhs> PartialEq<FixedI128<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU128,

source§

fn eq(&self, rhs: &FixedI128<FracRhs>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<FracLhs, FracRhs> PartialEq<FixedI16<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU16,

source§

fn eq(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<FracLhs, FracRhs> PartialEq<FixedI16<FracRhs>> for FixedI32<FracLhs>where FracLhs: LeEqU32, FracRhs: LeEqU16,

source§

fn eq(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<FracLhs, FracRhs> PartialEq<FixedI16<FracRhs>> for FixedI8<FracLhs>where FracLhs: LeEqU8, FracRhs: LeEqU16,

source§

fn eq(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<FracLhs, FracRhs> PartialEq<FixedI16<FracRhs>> for FixedU16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU16,

source§

fn eq(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<FracLhs, FracRhs> PartialEq<FixedI16<FracRhs>> for FixedU32<FracLhs>where FracLhs: LeEqU32, FracRhs: LeEqU16,

source§

fn eq(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<FracLhs, FracRhs> PartialEq<FixedI16<FracRhs>> for FixedU8<FracLhs>where FracLhs: LeEqU8, FracRhs: LeEqU16,

source§

fn eq(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<FracLhs, FracRhs> PartialEq<FixedI32<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU32,

source§

fn eq(&self, rhs: &FixedI32<FracRhs>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<FracLhs, FracRhs> PartialEq<FixedI64<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU64,

source§

fn eq(&self, rhs: &FixedI64<FracRhs>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<FracLhs, FracRhs> PartialEq<FixedI8<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU8,

source§

fn eq(&self, rhs: &FixedI8<FracRhs>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<FracLhs, FracRhs> PartialEq<FixedU128<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU128,

source§

fn eq(&self, rhs: &FixedU128<FracRhs>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<FracLhs, FracRhs> PartialEq<FixedU16<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU16,

source§

fn eq(&self, rhs: &FixedU16<FracRhs>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<FracLhs, FracRhs> PartialEq<FixedU32<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU32,

source§

fn eq(&self, rhs: &FixedU32<FracRhs>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<FracLhs, FracRhs> PartialEq<FixedU64<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU64,

source§

fn eq(&self, rhs: &FixedU64<FracRhs>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<FracLhs, FracRhs> PartialEq<FixedU8<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU8,

source§

fn eq(&self, rhs: &FixedU8<FracRhs>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Frac> PartialEq<bf16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn eq(&self, rhs: &bf16) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Frac> PartialEq<f16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn eq(&self, rhs: &f16) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Frac> PartialEq<f32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn eq(&self, rhs: &f32) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Frac> PartialEq<f64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn eq(&self, rhs: &f64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Frac> PartialEq<i128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn eq(&self, rhs: &i128) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Frac> PartialEq<i16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn eq(&self, rhs: &i16) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Frac> PartialEq<i32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn eq(&self, rhs: &i32) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Frac> PartialEq<i64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn eq(&self, rhs: &i64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Frac> PartialEq<i8> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn eq(&self, rhs: &i8) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Frac> PartialEq<isize> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn eq(&self, rhs: &isize) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Frac> PartialEq<u128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn eq(&self, rhs: &u128) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Frac> PartialEq<u16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn eq(&self, rhs: &u16) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Frac> PartialEq<u32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn eq(&self, rhs: &u32) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Frac> PartialEq<u64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn eq(&self, rhs: &u64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Frac> PartialEq<u8> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn eq(&self, rhs: &u8) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Frac> PartialEq<usize> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn eq(&self, rhs: &usize) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Frac> PartialOrd<F128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn partial_cmp(&self, rhs: &F128) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &F128) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &F128) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &F128) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &F128) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Frac> PartialOrd<F128Bits> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn partial_cmp(&self, rhs: &F128Bits) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &F128Bits) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &F128Bits) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &F128Bits) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &F128Bits) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<FracLhs, FracRhs> PartialOrd<FixedI128<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU128,

source§

fn partial_cmp(&self, rhs: &FixedI128<FracRhs>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &FixedI128<FracRhs>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &FixedI128<FracRhs>) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &FixedI128<FracRhs>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &FixedI128<FracRhs>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<FracLhs, FracRhs> PartialOrd<FixedI16<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU16,

source§

fn partial_cmp(&self, rhs: &FixedI16<FracRhs>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<FracLhs, FracRhs> PartialOrd<FixedI16<FracRhs>> for FixedI32<FracLhs>where FracLhs: LeEqU32, FracRhs: LeEqU16,

source§

fn partial_cmp(&self, rhs: &FixedI16<FracRhs>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<FracLhs, FracRhs> PartialOrd<FixedI16<FracRhs>> for FixedI8<FracLhs>where FracLhs: LeEqU8, FracRhs: LeEqU16,

source§

fn partial_cmp(&self, rhs: &FixedI16<FracRhs>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<FracLhs, FracRhs> PartialOrd<FixedI16<FracRhs>> for FixedU16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU16,

source§

fn partial_cmp(&self, rhs: &FixedI16<FracRhs>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<FracLhs, FracRhs> PartialOrd<FixedI16<FracRhs>> for FixedU32<FracLhs>where FracLhs: LeEqU32, FracRhs: LeEqU16,

source§

fn partial_cmp(&self, rhs: &FixedI16<FracRhs>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<FracLhs, FracRhs> PartialOrd<FixedI16<FracRhs>> for FixedU8<FracLhs>where FracLhs: LeEqU8, FracRhs: LeEqU16,

source§

fn partial_cmp(&self, rhs: &FixedI16<FracRhs>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &FixedI16<FracRhs>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<FracLhs, FracRhs> PartialOrd<FixedI32<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU32,

source§

fn partial_cmp(&self, rhs: &FixedI32<FracRhs>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &FixedI32<FracRhs>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &FixedI32<FracRhs>) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &FixedI32<FracRhs>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &FixedI32<FracRhs>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<FracLhs, FracRhs> PartialOrd<FixedI64<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU64,

source§

fn partial_cmp(&self, rhs: &FixedI64<FracRhs>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &FixedI64<FracRhs>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &FixedI64<FracRhs>) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &FixedI64<FracRhs>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &FixedI64<FracRhs>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<FracLhs, FracRhs> PartialOrd<FixedI8<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU8,

source§

fn partial_cmp(&self, rhs: &FixedI8<FracRhs>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &FixedI8<FracRhs>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &FixedI8<FracRhs>) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &FixedI8<FracRhs>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &FixedI8<FracRhs>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<FracLhs, FracRhs> PartialOrd<FixedU128<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU128,

source§

fn partial_cmp(&self, rhs: &FixedU128<FracRhs>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &FixedU128<FracRhs>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &FixedU128<FracRhs>) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &FixedU128<FracRhs>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &FixedU128<FracRhs>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<FracLhs, FracRhs> PartialOrd<FixedU16<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU16,

source§

fn partial_cmp(&self, rhs: &FixedU16<FracRhs>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &FixedU16<FracRhs>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &FixedU16<FracRhs>) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &FixedU16<FracRhs>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &FixedU16<FracRhs>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<FracLhs, FracRhs> PartialOrd<FixedU32<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU32,

source§

fn partial_cmp(&self, rhs: &FixedU32<FracRhs>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &FixedU32<FracRhs>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &FixedU32<FracRhs>) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &FixedU32<FracRhs>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &FixedU32<FracRhs>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<FracLhs, FracRhs> PartialOrd<FixedU64<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU64,

source§

fn partial_cmp(&self, rhs: &FixedU64<FracRhs>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &FixedU64<FracRhs>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &FixedU64<FracRhs>) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &FixedU64<FracRhs>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &FixedU64<FracRhs>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<FracLhs, FracRhs> PartialOrd<FixedU8<FracRhs>> for FixedI16<FracLhs>where FracLhs: LeEqU16, FracRhs: LeEqU8,

source§

fn partial_cmp(&self, rhs: &FixedU8<FracRhs>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &FixedU8<FracRhs>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &FixedU8<FracRhs>) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &FixedU8<FracRhs>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &FixedU8<FracRhs>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Frac> PartialOrd<bf16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn partial_cmp(&self, rhs: &bf16) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &bf16) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &bf16) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &bf16) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &bf16) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Frac> PartialOrd<f16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn partial_cmp(&self, rhs: &f16) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &f16) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &f16) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &f16) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &f16) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Frac> PartialOrd<f32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn partial_cmp(&self, rhs: &f32) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &f32) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &f32) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &f32) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &f32) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Frac> PartialOrd<f64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn partial_cmp(&self, rhs: &f64) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &f64) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &f64) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &f64) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &f64) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Frac> PartialOrd<i128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn partial_cmp(&self, rhs: &i128) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &i128) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &i128) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &i128) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &i128) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Frac> PartialOrd<i16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn partial_cmp(&self, rhs: &i16) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &i16) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &i16) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &i16) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &i16) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Frac> PartialOrd<i32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn partial_cmp(&self, rhs: &i32) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &i32) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &i32) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &i32) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &i32) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Frac> PartialOrd<i64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn partial_cmp(&self, rhs: &i64) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &i64) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &i64) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &i64) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &i64) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Frac> PartialOrd<i8> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn partial_cmp(&self, rhs: &i8) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &i8) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &i8) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &i8) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &i8) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Frac> PartialOrd<isize> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn partial_cmp(&self, rhs: &isize) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &isize) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &isize) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &isize) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &isize) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Frac> PartialOrd<u128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn partial_cmp(&self, rhs: &u128) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &u128) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &u128) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &u128) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &u128) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Frac> PartialOrd<u16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn partial_cmp(&self, rhs: &u16) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &u16) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &u16) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &u16) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &u16) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Frac> PartialOrd<u32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn partial_cmp(&self, rhs: &u32) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &u32) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &u32) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &u32) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &u32) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Frac> PartialOrd<u64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn partial_cmp(&self, rhs: &u64) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &u64) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &u64) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &u64) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &u64) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Frac> PartialOrd<u8> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn partial_cmp(&self, rhs: &u8) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &u8) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &u8) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &u8) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &u8) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Frac> PartialOrd<usize> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn partial_cmp(&self, rhs: &usize) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &usize) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &usize) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &usize) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &usize) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<'a, Frac> Product<&'a FixedI16<Frac>> for FixedI16<Frac>where Frac: 'a + LeEqU16,

source§

fn product<I>(iter: I) -> FixedI16<Frac>where I: Iterator<Item = &'a FixedI16<Frac>>,

Method which takes an iterator and generates Self from the elements by multiplying the items.
source§

impl<Frac> Product<FixedI16<Frac>> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn product<I>(iter: I) -> FixedI16<Frac>where I: Iterator<Item = FixedI16<Frac>>,

Method which takes an iterator and generates Self from the elements by multiplying the items.
source§

impl<Frac> Rem<&FixedI16<Frac>> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: &FixedI16<Frac>) -> FixedI16<Frac>

Performs the % operation. Read more
source§

impl<Frac> Rem<&FixedI16<Frac>> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: &FixedI16<Frac>) -> FixedI16<Frac>

Performs the % operation. Read more
source§

impl<Frac> Rem<&NonZeroI16> for &FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: &NonZeroI16) -> FixedI16<Frac>

Performs the % operation. Read more
source§

impl<Frac> Rem<&NonZeroI16> for FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: &NonZeroI16) -> FixedI16<Frac>

Performs the % operation. Read more
source§

impl<Frac> Rem<&i16> for &FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: &i16) -> FixedI16<Frac>

Performs the % operation. Read more
source§

impl<Frac> Rem<&i16> for FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: &i16) -> FixedI16<Frac>

Performs the % operation. Read more
source§

impl<Frac> Rem<FixedI16<Frac>> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Performs the % operation. Read more
source§

impl<Frac> Rem<FixedI16<Frac>> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Performs the % operation. Read more
source§

impl<Frac> Rem<NonZeroI16> for &FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: NonZeroI16) -> FixedI16<Frac>

Performs the % operation. Read more
source§

impl<Frac> Rem<NonZeroI16> for FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: NonZeroI16) -> FixedI16<Frac>

Performs the % operation. Read more
source§

impl<Frac> Rem<i16> for &FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: i16) -> FixedI16<Frac>

Performs the % operation. Read more
source§

impl<Frac> Rem<i16> for FixedI16<Frac>where Frac: LeEqU16,

§

type Output = FixedI16<Frac>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: i16) -> FixedI16<Frac>

Performs the % operation. Read more
source§

impl<Frac> RemAssign<&FixedI16<Frac>> for FixedI16<Frac>

source§

fn rem_assign(&mut self, rhs: &FixedI16<Frac>)

Performs the %= operation. Read more
source§

impl<Frac> RemAssign<&NonZeroI16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn rem_assign(&mut self, rhs: &NonZeroI16)

Performs the %= operation. Read more
source§

impl<Frac> RemAssign<&i16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn rem_assign(&mut self, rhs: &i16)

Performs the %= operation. Read more
source§

impl<Frac> RemAssign<FixedI16<Frac>> for FixedI16<Frac>

source§

fn rem_assign(&mut self, rhs: FixedI16<Frac>)

Performs the %= operation. Read more
source§

impl<Frac> RemAssign<NonZeroI16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn rem_assign(&mut self, rhs: NonZeroI16)

Performs the %= operation. Read more
source§

impl<Frac> RemAssign<i16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn rem_assign(&mut self, rhs: i16)

Performs the %= operation. Read more
source§

impl<Frac> SaturatingCast<F128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn saturating_cast(self) -> F128

Casts the value.
source§

impl<Frac> SaturatingCast<F128Bits> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn saturating_cast(self) -> F128Bits

Casts the value.
source§

impl<FracSrc, FracDst> SaturatingCast<FixedI128<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU128,

source§

fn saturating_cast(self) -> FixedI128<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> SaturatingCast<FixedI16<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU16,

source§

fn saturating_cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> SaturatingCast<FixedI16<FracDst>> for FixedI32<FracSrc>where FracSrc: LeEqU32, FracDst: LeEqU16,

source§

fn saturating_cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> SaturatingCast<FixedI16<FracDst>> for FixedI8<FracSrc>where FracSrc: LeEqU8, FracDst: LeEqU16,

source§

fn saturating_cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> SaturatingCast<FixedI16<FracDst>> for FixedU16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU16,

source§

fn saturating_cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> SaturatingCast<FixedI16<FracDst>> for FixedU32<FracSrc>where FracSrc: LeEqU32, FracDst: LeEqU16,

source§

fn saturating_cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> SaturatingCast<FixedI16<FracDst>> for FixedU8<FracSrc>where FracSrc: LeEqU8, FracDst: LeEqU16,

source§

fn saturating_cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> SaturatingCast<FixedI32<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU32,

source§

fn saturating_cast(self) -> FixedI32<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> SaturatingCast<FixedI64<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU64,

source§

fn saturating_cast(self) -> FixedI64<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> SaturatingCast<FixedI8<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU8,

source§

fn saturating_cast(self) -> FixedI8<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> SaturatingCast<FixedU128<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU128,

source§

fn saturating_cast(self) -> FixedU128<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> SaturatingCast<FixedU16<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU16,

source§

fn saturating_cast(self) -> FixedU16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> SaturatingCast<FixedU32<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU32,

source§

fn saturating_cast(self) -> FixedU32<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> SaturatingCast<FixedU64<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU64,

source§

fn saturating_cast(self) -> FixedU64<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> SaturatingCast<FixedU8<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU8,

source§

fn saturating_cast(self) -> FixedU8<FracDst>

Casts the value.
source§

impl<Frac> SaturatingCast<bf16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn saturating_cast(self) -> bf16

Casts the value.
source§

impl<Frac> SaturatingCast<f16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn saturating_cast(self) -> f16

Casts the value.
source§

impl<Frac> SaturatingCast<f32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn saturating_cast(self) -> f32

Casts the value.
source§

impl<Frac> SaturatingCast<f64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn saturating_cast(self) -> f64

Casts the value.
source§

impl<Frac> SaturatingCast<i128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn saturating_cast(self) -> i128

Casts the value.
source§

impl<Frac> SaturatingCast<i16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn saturating_cast(self) -> i16

Casts the value.
source§

impl<Frac> SaturatingCast<i32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn saturating_cast(self) -> i32

Casts the value.
source§

impl<Frac> SaturatingCast<i64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn saturating_cast(self) -> i64

Casts the value.
source§

impl<Frac> SaturatingCast<i8> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn saturating_cast(self) -> i8

Casts the value.
source§

impl<Frac> SaturatingCast<isize> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn saturating_cast(self) -> isize

Casts the value.
source§

impl<Frac> SaturatingCast<u128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn saturating_cast(self) -> u128

Casts the value.
source§

impl<Frac> SaturatingCast<u16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn saturating_cast(self) -> u16

Casts the value.
source§

impl<Frac> SaturatingCast<u32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn saturating_cast(self) -> u32

Casts the value.
source§

impl<Frac> SaturatingCast<u64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn saturating_cast(self) -> u64

Casts the value.
source§

impl<Frac> SaturatingCast<u8> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn saturating_cast(self) -> u8

Casts the value.
source§

impl<Frac> SaturatingCast<usize> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn saturating_cast(self) -> usize

Casts the value.
source§

impl<Frac> Shl<&i128> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &i128) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&i128> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &i128) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&i16> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &i16) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&i16> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &i16) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&i32> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &i32) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&i32> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &i32) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&i64> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &i64) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&i64> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &i64) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&i8> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &i8) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&i8> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &i8) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&isize> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &isize) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&isize> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &isize) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&u128> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &u128) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&u128> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &u128) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&u16> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &u16) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&u16> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &u16) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&u32> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &u32) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&u32> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &u32) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&u64> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &u64) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&u64> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &u64) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&u8> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &u8) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&u8> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &u8) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&usize> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &usize) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<&usize> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: &usize) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<i128> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: i128) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<i128> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: i128) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<i16> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: i16) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<i16> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: i16) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<i32> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: i32) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<i32> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: i32) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<i64> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: i64) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<i64> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: i64) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<i8> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: i8) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<i8> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: i8) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<isize> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: isize) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<isize> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: isize) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<u128> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: u128) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<u128> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: u128) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<u16> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: u16) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<u16> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: u16) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<u32> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: u32) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<u32> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: u32) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<u64> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: u64) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<u64> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: u64) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<u8> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: u8) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<u8> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: u8) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<usize> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: usize) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> Shl<usize> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: usize) -> FixedI16<Frac>

Performs the << operation. Read more
source§

impl<Frac> ShlAssign<&i128> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: &i128)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<&i16> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: &i16)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<&i32> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: &i32)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<&i64> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: &i64)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<&i8> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: &i8)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<&isize> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: &isize)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<&u128> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: &u128)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<&u16> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: &u16)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<&u32> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: &u32)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<&u64> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: &u64)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<&u8> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: &u8)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<&usize> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: &usize)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<i128> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: i128)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<i16> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: i16)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<i32> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: i32)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<i64> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: i64)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<i8> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: i8)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<isize> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: isize)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<u128> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: u128)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<u16> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: u16)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<u32> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: u32)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<u64> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: u64)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<u8> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: u8)

Performs the <<= operation. Read more
source§

impl<Frac> ShlAssign<usize> for FixedI16<Frac>

source§

fn shl_assign(&mut self, rhs: usize)

Performs the <<= operation. Read more
source§

impl<Frac> Shr<&i128> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &i128) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&i128> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &i128) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&i16> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &i16) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&i16> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &i16) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&i32> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &i32) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&i32> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &i32) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&i64> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &i64) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&i64> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &i64) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&i8> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &i8) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&i8> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &i8) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&isize> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &isize) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&isize> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &isize) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&u128> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &u128) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&u128> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &u128) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&u16> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &u16) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&u16> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &u16) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&u32> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &u32) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&u32> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &u32) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&u64> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &u64) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&u64> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &u64) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&u8> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &u8) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&u8> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &u8) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&usize> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &usize) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<&usize> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: &usize) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<i128> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: i128) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<i128> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: i128) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<i16> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: i16) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<i16> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: i16) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<i32> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: i32) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<i32> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: i32) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<i64> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: i64) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<i64> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: i64) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<i8> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: i8) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<i8> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: i8) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<isize> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: isize) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<isize> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: isize) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<u128> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: u128) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<u128> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: u128) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<u16> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: u16) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<u16> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: u16) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<u32> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: u32) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<u32> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: u32) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<u64> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: u64) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<u64> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: u64) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<u8> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: u8) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<u8> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: u8) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<usize> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: usize) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> Shr<usize> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: usize) -> FixedI16<Frac>

Performs the >> operation. Read more
source§

impl<Frac> ShrAssign<&i128> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: &i128)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<&i16> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: &i16)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<&i32> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: &i32)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<&i64> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: &i64)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<&i8> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: &i8)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<&isize> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: &isize)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<&u128> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: &u128)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<&u16> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: &u16)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<&u32> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: &u32)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<&u64> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: &u64)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<&u8> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: &u8)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<&usize> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: &usize)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<i128> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: i128)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<i16> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: i16)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<i32> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: i32)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<i64> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: i64)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<i8> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: i8)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<isize> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: isize)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<u128> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: u128)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<u16> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: u16)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<u32> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: u32)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<u64> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: u64)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<u8> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: u8)

Performs the >>= operation. Read more
source§

impl<Frac> ShrAssign<usize> for FixedI16<Frac>

source§

fn shr_assign(&mut self, rhs: usize)

Performs the >>= operation. Read more
source§

impl<Frac> Sub<&FixedI16<Frac>> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &FixedI16<Frac>) -> FixedI16<Frac>

Performs the - operation. Read more
source§

impl<Frac> Sub<&FixedI16<Frac>> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &FixedI16<Frac>) -> FixedI16<Frac>

Performs the - operation. Read more
source§

impl<Frac> Sub<FixedI16<Frac>> for &FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Performs the - operation. Read more
source§

impl<Frac> Sub<FixedI16<Frac>> for FixedI16<Frac>

§

type Output = FixedI16<Frac>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: FixedI16<Frac>) -> FixedI16<Frac>

Performs the - operation. Read more
source§

impl<Frac> SubAssign<&FixedI16<Frac>> for FixedI16<Frac>

source§

fn sub_assign(&mut self, rhs: &FixedI16<Frac>)

Performs the -= operation. Read more
source§

impl<Frac> SubAssign<FixedI16<Frac>> for FixedI16<Frac>

source§

fn sub_assign(&mut self, rhs: FixedI16<Frac>)

Performs the -= operation. Read more
source§

impl<'a, Frac> Sum<&'a FixedI16<Frac>> for FixedI16<Frac>where Frac: 'a,

source§

fn sum<I>(iter: I) -> FixedI16<Frac>where I: Iterator<Item = &'a FixedI16<Frac>>,

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl<Frac> Sum<FixedI16<Frac>> for FixedI16<Frac>

source§

fn sum<I>(iter: I) -> FixedI16<Frac>where I: Iterator<Item = FixedI16<Frac>>,

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl<Frac> ToFixed for FixedI16<Frac>where Frac: LeEqU16,

source§

fn to_fixed<F>(self) -> Fwhere F: Fixed,

Converts a fixed-point number.

Any extra fractional bits are discarded, which rounds towards −∞.

Panics

When debug assertions are enabled, panics if the value does not fit. When debug assertions are not enabled, the wrapped value can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_to_fixed instead.

source§

fn checked_to_fixed<F>(self) -> Option<F>where F: Fixed,

Converts a fixed-point number if it fits, otherwise returns [None].

Any extra fractional bits are discarded, which rounds towards −∞.

source§

fn saturating_to_fixed<F>(self) -> Fwhere F: Fixed,

Converts a fixed-point number, saturating if it does not fit.

Any extra fractional bits are discarded, which rounds towards −∞.

source§

fn wrapping_to_fixed<F>(self) -> Fwhere F: Fixed,

Converts a fixed-point number, wrapping if it does not fit.

Any extra fractional bits are discarded, which rounds towards −∞.

source§

fn overflowing_to_fixed<F>(self) -> (F, bool)where F: Fixed,

Converts a fixed-point number.

Returns a [tuple] of the value and a [bool] indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Any extra fractional bits are discarded, which rounds towards −∞.

source§

fn unwrapped_to_fixed<F>(self) -> Fwhere F: Fixed,

Converts a fixed-point number, panicking if it does not fit.

Any extra fractional bits are discarded, which rounds towards −∞.

Panics

Panics if the value does not fit, even when debug assertions are not enabled.

source§

impl<Frac> TransparentWrapper<i16> for FixedI16<Frac>

§

fn wrap(s: Inner) -> Selfwhere Self: Sized,

Convert the inner type into the wrapper type.
§

fn wrap_ref(s: &Inner) -> &Self

Convert a reference to the inner type into a reference to the wrapper type.
§

fn wrap_mut(s: &mut Inner) -> &mut Self

Convert a mutable reference to the inner type into a mutable reference to the wrapper type.
§

fn wrap_slice(s: &[Inner]) -> &[Self]where Self: Sized,

Convert a slice to the inner type into a slice to the wrapper type.
§

fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self]where Self: Sized,

Convert a mutable slice to the inner type into a mutable slice to the wrapper type.
§

fn peel(s: Self) -> Innerwhere Self: Sized,

Convert the wrapper type into the inner type.
§

fn peel_ref(s: &Self) -> &Inner

Convert a reference to the wrapper type into a reference to the inner type.
§

fn peel_mut(s: &mut Self) -> &mut Inner

Convert a mutable reference to the wrapper type into a mutable reference to the inner type.
§

fn peel_slice(s: &[Self]) -> &[Inner]where Self: Sized,

Convert a slice to the wrapped type into a slice to the inner type.
§

fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner]where Self: Sized,

Convert a mutable slice to the wrapped type into a mutable slice to the inner type.
source§

impl<Frac> UnwrappedCast<F128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn unwrapped_cast(self) -> F128

Casts the value.
source§

impl<Frac> UnwrappedCast<F128Bits> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn unwrapped_cast(self) -> F128Bits

Casts the value.
source§

impl<FracSrc, FracDst> UnwrappedCast<FixedI128<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU128,

source§

fn unwrapped_cast(self) -> FixedI128<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> UnwrappedCast<FixedI16<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU16,

source§

fn unwrapped_cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> UnwrappedCast<FixedI16<FracDst>> for FixedI32<FracSrc>where FracSrc: LeEqU32, FracDst: LeEqU16,

source§

fn unwrapped_cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> UnwrappedCast<FixedI16<FracDst>> for FixedI8<FracSrc>where FracSrc: LeEqU8, FracDst: LeEqU16,

source§

fn unwrapped_cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> UnwrappedCast<FixedI16<FracDst>> for FixedU16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU16,

source§

fn unwrapped_cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> UnwrappedCast<FixedI16<FracDst>> for FixedU32<FracSrc>where FracSrc: LeEqU32, FracDst: LeEqU16,

source§

fn unwrapped_cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> UnwrappedCast<FixedI16<FracDst>> for FixedU8<FracSrc>where FracSrc: LeEqU8, FracDst: LeEqU16,

source§

fn unwrapped_cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> UnwrappedCast<FixedI32<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU32,

source§

fn unwrapped_cast(self) -> FixedI32<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> UnwrappedCast<FixedI64<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU64,

source§

fn unwrapped_cast(self) -> FixedI64<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> UnwrappedCast<FixedI8<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU8,

source§

fn unwrapped_cast(self) -> FixedI8<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> UnwrappedCast<FixedU128<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU128,

source§

fn unwrapped_cast(self) -> FixedU128<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> UnwrappedCast<FixedU16<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU16,

source§

fn unwrapped_cast(self) -> FixedU16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> UnwrappedCast<FixedU32<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU32,

source§

fn unwrapped_cast(self) -> FixedU32<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> UnwrappedCast<FixedU64<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU64,

source§

fn unwrapped_cast(self) -> FixedU64<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> UnwrappedCast<FixedU8<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU8,

source§

fn unwrapped_cast(self) -> FixedU8<FracDst>

Casts the value.
source§

impl<Frac> UnwrappedCast<bf16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn unwrapped_cast(self) -> bf16

Casts the value.
source§

impl<Frac> UnwrappedCast<f16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn unwrapped_cast(self) -> f16

Casts the value.
source§

impl<Frac> UnwrappedCast<f32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn unwrapped_cast(self) -> f32

Casts the value.
source§

impl<Frac> UnwrappedCast<f64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn unwrapped_cast(self) -> f64

Casts the value.
source§

impl<Frac> UnwrappedCast<i128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn unwrapped_cast(self) -> i128

Casts the value.
source§

impl<Frac> UnwrappedCast<i16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn unwrapped_cast(self) -> i16

Casts the value.
source§

impl<Frac> UnwrappedCast<i32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn unwrapped_cast(self) -> i32

Casts the value.
source§

impl<Frac> UnwrappedCast<i64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn unwrapped_cast(self) -> i64

Casts the value.
source§

impl<Frac> UnwrappedCast<i8> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn unwrapped_cast(self) -> i8

Casts the value.
source§

impl<Frac> UnwrappedCast<isize> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn unwrapped_cast(self) -> isize

Casts the value.
source§

impl<Frac> UnwrappedCast<u128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn unwrapped_cast(self) -> u128

Casts the value.
source§

impl<Frac> UnwrappedCast<u16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn unwrapped_cast(self) -> u16

Casts the value.
source§

impl<Frac> UnwrappedCast<u32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn unwrapped_cast(self) -> u32

Casts the value.
source§

impl<Frac> UnwrappedCast<u64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn unwrapped_cast(self) -> u64

Casts the value.
source§

impl<Frac> UnwrappedCast<u8> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn unwrapped_cast(self) -> u8

Casts the value.
source§

impl<Frac> UnwrappedCast<usize> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn unwrapped_cast(self) -> usize

Casts the value.
source§

impl<Frac> UpperHex for FixedI16<Frac>where Frac: LeEqU16,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter.
source§

impl<Frac> WrappingCast<F128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn wrapping_cast(self) -> F128

Casts the value.
source§

impl<Frac> WrappingCast<F128Bits> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn wrapping_cast(self) -> F128Bits

Casts the value.
source§

impl<FracSrc, FracDst> WrappingCast<FixedI128<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU128,

source§

fn wrapping_cast(self) -> FixedI128<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> WrappingCast<FixedI16<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU16,

source§

fn wrapping_cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> WrappingCast<FixedI16<FracDst>> for FixedI32<FracSrc>where FracSrc: LeEqU32, FracDst: LeEqU16,

source§

fn wrapping_cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> WrappingCast<FixedI16<FracDst>> for FixedI8<FracSrc>where FracSrc: LeEqU8, FracDst: LeEqU16,

source§

fn wrapping_cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> WrappingCast<FixedI16<FracDst>> for FixedU16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU16,

source§

fn wrapping_cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> WrappingCast<FixedI16<FracDst>> for FixedU32<FracSrc>where FracSrc: LeEqU32, FracDst: LeEqU16,

source§

fn wrapping_cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> WrappingCast<FixedI16<FracDst>> for FixedU8<FracSrc>where FracSrc: LeEqU8, FracDst: LeEqU16,

source§

fn wrapping_cast(self) -> FixedI16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> WrappingCast<FixedI32<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU32,

source§

fn wrapping_cast(self) -> FixedI32<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> WrappingCast<FixedI64<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU64,

source§

fn wrapping_cast(self) -> FixedI64<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> WrappingCast<FixedI8<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU8,

source§

fn wrapping_cast(self) -> FixedI8<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> WrappingCast<FixedU128<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU128,

source§

fn wrapping_cast(self) -> FixedU128<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> WrappingCast<FixedU16<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU16,

source§

fn wrapping_cast(self) -> FixedU16<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> WrappingCast<FixedU32<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU32,

source§

fn wrapping_cast(self) -> FixedU32<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> WrappingCast<FixedU64<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU64,

source§

fn wrapping_cast(self) -> FixedU64<FracDst>

Casts the value.
source§

impl<FracSrc, FracDst> WrappingCast<FixedU8<FracDst>> for FixedI16<FracSrc>where FracSrc: LeEqU16, FracDst: LeEqU8,

source§

fn wrapping_cast(self) -> FixedU8<FracDst>

Casts the value.
source§

impl<Frac> WrappingCast<bf16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn wrapping_cast(self) -> bf16

Casts the value.
source§

impl<Frac> WrappingCast<f16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn wrapping_cast(self) -> f16

Casts the value.
source§

impl<Frac> WrappingCast<f32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn wrapping_cast(self) -> f32

Casts the value.
source§

impl<Frac> WrappingCast<f64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn wrapping_cast(self) -> f64

Casts the value.
source§

impl<Frac> WrappingCast<i128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn wrapping_cast(self) -> i128

Casts the value.
source§

impl<Frac> WrappingCast<i16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn wrapping_cast(self) -> i16

Casts the value.
source§

impl<Frac> WrappingCast<i32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn wrapping_cast(self) -> i32

Casts the value.
source§

impl<Frac> WrappingCast<i64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn wrapping_cast(self) -> i64

Casts the value.
source§

impl<Frac> WrappingCast<i8> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn wrapping_cast(self) -> i8

Casts the value.
source§

impl<Frac> WrappingCast<isize> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn wrapping_cast(self) -> isize

Casts the value.
source§

impl<Frac> WrappingCast<u128> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn wrapping_cast(self) -> u128

Casts the value.
source§

impl<Frac> WrappingCast<u16> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn wrapping_cast(self) -> u16

Casts the value.
source§

impl<Frac> WrappingCast<u32> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn wrapping_cast(self) -> u32

Casts the value.
source§

impl<Frac> WrappingCast<u64> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn wrapping_cast(self) -> u64

Casts the value.
source§

impl<Frac> WrappingCast<u8> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn wrapping_cast(self) -> u8

Casts the value.
source§

impl<Frac> WrappingCast<usize> for FixedI16<Frac>where Frac: LeEqU16,

source§

fn wrapping_cast(self) -> usize

Casts the value.
source§

impl<Frac> Zeroable for FixedI16<Frac>

§

fn zeroed() -> Self

source§

impl<Frac> Copy for FixedI16<Frac>

source§

impl<Frac> Eq for FixedI16<Frac>where Frac: LeEqU16,

source§

impl<Frac> FixedOptionalFeatures for FixedI16<Frac>where Frac: LeEqU16,

source§

impl<Frac> Pod for FixedI16<Frac>where Frac: 'static,

Auto Trait Implementations§

§

impl<Frac> RefUnwindSafe for FixedI16<Frac>where Frac: RefUnwindSafe,

§

impl<Frac> Send for FixedI16<Frac>where Frac: Send,

§

impl<Frac> Sync for FixedI16<Frac>where Frac: Sync,

§

impl<Frac> Unpin for FixedI16<Frac>where Frac: Unpin,

§

impl<Frac> UnwindSafe for FixedI16<Frac>where Frac: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dstwhere T: Cast<Dst>,

Casts the value.
§

impl<T> Borrow<T> for Twhere T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Src, Dst> CastFrom<Src> for Dstwhere Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>where T: CheckedCast<Dst>,

Casts the value.
§

impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,

§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for Twhere U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

source§

impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere Dst: LosslessTryFrom<Src>,

source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
source§

impl<Src, Dst> LossyInto<Dst> for Srcwhere Dst: LossyFrom<Src>,

source§

fn lossy_into(self) -> Dst

Performs the conversion.
source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dstwhere T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> ToString for Twhere T: Display + ?Sized,

§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dstwhere T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dstwhere T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.
§

impl<T> AnyBitPattern for Twhere T: Pod,

§

impl<T> NoUninit for Twhere T: Pod,