Struct fixed::FixedU64[][src]

#[repr(transparent)]
pub struct FixedU64<Frac> { /* fields omitted */ }
Expand description

A 64-bit unsigned number with Frac fractional bits.

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

When f = 0, Δ = 1 and the fixed-point number behaves like a u64 with the value lying in the range 0 ≤ x < 264. When f = 64, Δ = 1/264 and the value lies in the range 0 ≤ x < 1.

Frac is an Unsigned as provided by the typenum crate; the plan is to to have a major version 2 with const generics instead when the Rust compiler support for them is powerful enough.

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

Examples

use fixed::{types::extra::U3, FixedU64};
let eleven = FixedU64::<U3>::from_num(11);
assert_eq!(eleven, FixedU64::<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, FixedU64::<U3>::from_bits(11 << 1));
assert_eq!(two_point_75, 2.75);
assert_eq!(two_point_75.to_string(), "2.8");

Implementations

impl<Frac> FixedU64<Frac>[src]

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

pub const ZERO: FixedU64<Frac>[src]

Zero.

Examples

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

pub const DELTA: FixedU64<Frac>[src]

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, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::DELTA, Fix::from_bits(1));
// binary 0.0001 is decimal 0.0625
assert_eq!(Fix::DELTA, 0.0625);

pub const MIN: FixedU64<Frac>[src]

The smallest value that can be represented.

The minimum of unsigned numbers is 0.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::MIN, Fix::from_bits(u64::MIN));

pub const MAX: FixedU64<Frac>[src]

The largest value that can be represented.

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

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::MAX, Fix::from_bits(u64::MAX));

pub const IS_SIGNED: bool[src]

false because the FixedU64 type is unsigned.

Examples

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

pub const fn from_bits(bits: u64) -> FixedU64<Frac>[src]

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

Examples

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

pub const fn to_bits(self) -> u64[src]

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

Examples

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

pub const fn from_be(f: FixedU64<Frac>) -> FixedU64<Frac>[src]

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

Examples

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

pub const fn from_le(f: FixedU64<Frac>) -> FixedU64<Frac>[src]

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

Examples

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

pub const fn to_be(self) -> FixedU64<Frac>[src]

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

Examples

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

pub const fn to_le(self) -> FixedU64<Frac>[src]

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

Examples

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

pub const fn swap_bytes(self) -> FixedU64<Frac>[src]

Reverses the byte order of the fixed-point number.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
let f = Fix::from_bits(0x1234_5678_9ABC_DE0F);
let swapped = Fix::from_bits(0x0FDE_BC9A_7856_3412);
assert_eq!(f.swap_bytes(), swapped);

pub const fn from_be_bytes(bytes: [u8; 8]) -> FixedU64<Frac>[src]

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

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(
    Fix::from_be_bytes([0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0x0F]),
    Fix::from_bits(0x1234_5678_9ABC_DE0F)
);

pub const fn from_le_bytes(bytes: [u8; 8]) -> FixedU64<Frac>[src]

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

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(
    Fix::from_le_bytes([0x0F, 0xDE, 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12]),
    Fix::from_bits(0x1234_5678_9ABC_DE0F)
);

pub const fn from_ne_bytes(bytes: [u8; 8]) -> FixedU64<Frac>[src]

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

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(
    if cfg!(target_endian = "big") {
        Fix::from_ne_bytes([0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0x0F])
    } else {
        Fix::from_ne_bytes([0x0F, 0xDE, 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12])
    },
    Fix::from_bits(0x1234_5678_9ABC_DE0F)
);

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

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

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
let val = Fix::from_bits(0x1234_5678_9ABC_DE0F);
assert_eq!(
    val.to_be_bytes(),
    [0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0x0F]
);

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

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

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
let val = Fix::from_bits(0x1234_5678_9ABC_DE0F);
assert_eq!(
    val.to_le_bytes(),
    [0x0F, 0xDE, 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12]
);

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

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

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
let val = Fix::from_bits(0x1234_5678_9ABC_DE0F);
assert_eq!(
    val.to_ne_bytes(),
    if cfg!(target_endian = "big") {
        [0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0x0F]
    } else {
        [0x0F, 0xDE, 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12]
    }
);

pub const fn count_ones(self) -> u32[src]

Returns the number of ones in the binary representation.

Examples

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

pub const fn count_zeros(self) -> u32[src]

Returns the number of zeros in the binary representation.

Examples

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

pub const fn leading_ones(self) -> u32[src]

Returns the number of leading ones in the binary representation.

Examples

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

pub const fn leading_zeros(self) -> u32[src]

Returns the number of leading zeros in the binary representation.

Examples

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

pub const fn trailing_ones(self) -> u32[src]

Returns the number of trailing ones in the binary representation.

Examples

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

pub const fn trailing_zeros(self) -> u32[src]

Returns the number of trailing zeros in the binary representation.

Examples

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

pub const fn significant_bits(self) -> u32[src]

Returns the number of bits required to represent the value.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(0).significant_bits(), 0);      // “____.____”
assert_eq!(Fix::from_num(0.0625).significant_bits(), 1); // “____.___1”
assert_eq!(Fix::from_num(1).significant_bits(), 5);      // “___1.0000”
assert_eq!(Fix::from_num(3).significant_bits(), 6);      // “__11.0000”

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn reverse_bits(self) -> FixedU64<Frac>
[src]

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

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn rotate_left(self, n: u32) -> FixedU64<Frac>
[src]

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

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
let bits: u64 = (0b111 << (64 - 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));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn rotate_right(self, n: u32) -> FixedU64<Frac>
[src]

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

Examples

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

pub const fn is_zero(self) -> bool[src]

Returns true if the number is zero.

Examples

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

pub const fn is_power_of_two(self) -> bool[src]

Returns true if the fixed-point number is 2k for some integer k.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
// 3/8 is 0.0110
let three_eights = Fix::from_bits(0b0110);
// 1/2 is 0.1000
let half = Fix::from_bits(0b1000);
assert!(!three_eights.is_power_of_two());
assert!(half.is_power_of_two());

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn wide_mul<RhsFrac>(
    self,
    rhs: FixedU64<RhsFrac>
) -> FixedU128<Sum<Frac, RhsFrac>> where
    Frac: Add<RhsFrac>, 
[src]

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

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

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn mul_add<MulFrac: LeEqU64>(
    self,
    mul: FixedU64<MulFrac>,
    add: FixedU64<Frac>
) -> FixedU64<Frac>
[src]

Multiply and add. Returns self × mul + add.

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, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(
    Fix::from_num(4).mul_add(Fix::from_num(0.5), Fix::from_num(3)),
    Fix::from_num(5)
);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn rem_euclid(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Remainder for Euclidean division.

Panics

Panics if the divisor is zero.

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn dist(self, other: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Returns the distance from self to other.

The distance is the absolute value of the difference.

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn mean(self, other: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Returns the mean of self and other.

Examples

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

pub const fn highest_one(self) -> FixedU64<Frac>[src]

Returns the highest one in the binary representation, or zero if self is zero.

If self > 0, the highest one is equal to the largest power of two that is ≤ self.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_bits(0b11_0010).highest_one(), Fix::from_bits(0b10_0000));
assert_eq!(Fix::from_num(0.3).highest_one(), Fix::from_num(0.25));
assert_eq!(Fix::from_num(4).highest_one(), Fix::from_num(4));
assert_eq!(Fix::from_num(6.5).highest_one(), Fix::from_num(4));
assert_eq!(Fix::ZERO.highest_one(), Fix::ZERO);

pub const fn next_power_of_two(self) -> FixedU64<Frac>[src]

Returns the smallest power of two that is ≥ self.

Panics

When debug assertions are enabled, panics if the next power of two is too large to represent. When debug assertions are not enabled, zero can be returned, but it is not considered a breaking change if in the future it panics; if this is not desirable use checked_next_power_of_two instead.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_bits(0b11_0010).next_power_of_two(), Fix::from_bits(0b100_0000));
assert_eq!(Fix::from_num(0.3).next_power_of_two(), Fix::from_num(0.5));
assert_eq!(Fix::from_num(4).next_power_of_two(), Fix::from_num(4));
assert_eq!(Fix::from_num(6.5).next_power_of_two(), Fix::from_num(8));

pub const fn const_not(self) -> FixedU64<Frac>[src]

Bitwise NOT. Usable in constant context.

This is equivalent to the ! operator and 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 trait are usable in constant context.

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn const_bitand(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Bitwise AND. Usable in constant context.

This is equivalent to the & operator and 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 trait are usable in constant context.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn const_bitor(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Bitwise OR. Usable in constant context.

This is equivalent to the | operator and 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 trait are usable in constant context.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn const_bitxor(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Bitwise XOR. Usable in constant context.

This is equivalent to the ^ operator and 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 trait are usable in constant context.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

pub const fn checked_neg(self) -> Option<FixedU64<Frac>>[src]

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

Only zero can be negated without overflow.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::ZERO.checked_neg(), Some(Fix::ZERO));
assert_eq!(Fix::from_num(5).checked_neg(), None);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn checked_add(self, rhs: FixedU64<Frac>) -> Option<FixedU64<Frac>>
[src]

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

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn checked_sub(self, rhs: FixedU64<Frac>) -> Option<FixedU64<Frac>>
[src]

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

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn checked_rem(self, rhs: FixedU64<Frac>) -> Option<FixedU64<Frac>>
[src]

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

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn checked_mul_add<MulFrac: LeEqU64>(
    self,
    mul: FixedU64<MulFrac>,
    add: FixedU64<Frac>
) -> Option<FixedU64<Frac>>
[src]

Checked multiply and add. Returns self × mul + add, or None 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, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn checked_mul_int(self, rhs: u64) -> Option<FixedU64<Frac>>
[src]

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

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn checked_div_int(self, rhs: u64) -> Option<FixedU64<Frac>>
[src]

Checked division by an integer. Returns the quotient, or None if the divisor is zero.

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn checked_rem_euclid(
    self,
    rhs: FixedU64<Frac>
) -> Option<FixedU64<Frac>>
[src]

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

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn checked_shl(self, rhs: u32) -> Option<FixedU64<Frac>>
[src]

Checked shift left. Returns the shifted number, or None if rhs ≥ 64.

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn checked_shr(self, rhs: u32) -> Option<FixedU64<Frac>>
[src]

Checked shift right. Returns the shifted number, or None if rhs ≥ 64.

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn checked_dist(self, other: FixedU64<Frac>) -> Option<FixedU64<Frac>>
[src]

Checked distance. Returns the distance from self to other.

The distance is the absolute value of the difference.

Can never overflow for unsigned types.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::ONE.checked_dist(Fix::from_num(5)), Some(Fix::from_num(4)));
assert_eq!(Fix::ZERO.checked_dist(Fix::MAX), Some(Fix::MAX));

pub const fn checked_next_power_of_two(self) -> Option<FixedU64<Frac>>[src]

Returns the smallest power of two that is ≥ self, or None if the next power of two is too large to represent.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
// 3/8 is 0.0110
let three_eights = Fix::from_bits(0b0110);
// 1/2 is 0.1000
let half = Fix::from_bits(0b1000);
assert_eq!(three_eights.checked_next_power_of_two(), Some(half));
assert!(Fix::MAX.checked_next_power_of_two().is_none());

pub const fn saturating_neg(self) -> FixedU64<Frac>[src]

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

This method always returns zero.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::ZERO.saturating_neg(), Fix::from_num(0));
assert_eq!(Fix::from_num(5).saturating_neg(), Fix::ZERO);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn saturating_add(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Saturating addition. Returns the sum, saturating on overflow.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn saturating_sub(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Saturating subtraction. Returns the difference, saturating on overflow.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(5).saturating_sub(Fix::from_num(3)), Fix::from_num(2));
assert_eq!(Fix::ZERO.saturating_sub(Fix::ONE), Fix::ZERO);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn saturating_mul_add<MulFrac: LeEqU64>(
    self,
    mul: FixedU64<MulFrac>,
    add: FixedU64<Frac>
) -> FixedU64<Frac>
[src]

Saturating multiply and add. Returns self × mul + add, saturating 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, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn saturating_mul_int(self, rhs: u64) -> FixedU64<Frac>
[src]

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

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn saturating_dist(self, other: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Saturating distance. Returns the distance from self to other.

The distance is the absolute value of the difference.

Can never overflow for unsigned types.

Examples

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

pub const fn wrapping_neg(self) -> FixedU64<Frac>[src]

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

Only zero can be negated without overflow.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::ZERO.wrapping_neg(), Fix::from_num(0));
assert_eq!(Fix::from_num(5).wrapping_neg(), Fix::wrapping_from_num(-5));
let neg_five_bits = !Fix::from_num(5).to_bits() + 1;
assert_eq!(Fix::from_num(5).wrapping_neg(), Fix::from_bits(neg_five_bits));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn wrapping_add(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Wrapping addition. Returns the sum, wrapping on overflow.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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), one_minus_delta);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn wrapping_sub(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Wrapping subtraction. Returns the difference, wrapping on overflow.

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn wrapping_mul_add<MulFrac: LeEqU64>(
    self,
    mul: FixedU64<MulFrac>,
    add: FixedU64<Frac>
) -> FixedU64<Frac>
[src]

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, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn wrapping_mul_int(self, rhs: u64) -> FixedU64<Frac>
[src]

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

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn wrapping_div_int(self, rhs: u64) -> FixedU64<Frac>
[src]

Wrapping division by an integer. Returns the quotient.

Can never overflow for unsigned values.

Panics

Panics if the divisor is zero.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn wrapping_shl(self, rhs: u32) -> FixedU64<Frac>
[src]

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

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn wrapping_shr(self, rhs: u32) -> FixedU64<Frac>
[src]

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

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn wrapping_dist(self, other: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Wrapping distance. Returns the distance from self to other.

The distance is the absolute value of the difference.

Can never overflow for unsigned types.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::ONE.wrapping_dist(Fix::from_num(5)), Fix::from_num(4));
assert_eq!(Fix::ZERO.wrapping_dist(Fix::MAX), Fix::MAX);

pub const fn wrapping_next_power_of_two(self) -> FixedU64<Frac>[src]

Returns the smallest power of two that is ≥ self, wrapping to 0 if the next power of two is too large to represent.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
// 3/8 is 0.0110
let three_eights = Fix::from_bits(0b0110);
// 1/2 is 0.1000
let half = Fix::from_bits(0b1000);
assert_eq!(three_eights.wrapping_next_power_of_two(), half);
assert_eq!(Fix::MAX.wrapping_next_power_of_two(), 0);

pub fn unwrapped_neg(self) -> FixedU64<Frac>[src]

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

Only zero can be negated without overflow.

Panics

Panics if the result does not fit.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::ZERO.unwrapped_neg(), Fix::ZERO);

The following panics because of overflow.

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
let _overflow = Fix::from_num(5).unwrapped_neg();

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn unwrapped_add(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Unwrapped addition. Returns the sum, panicking on overflow.

Panics

Panics if the result does not fit.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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, FixedU64};
type Fix = FixedU64<U4>;
let _overflow = Fix::MAX.unwrapped_add(Fix::DELTA);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn unwrapped_sub(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Unwrapped subtraction. Returns the difference, panicking on overflow.

Panics

Panics if the result does not fit.

Examples

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

The following panics because of overflow.

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn unwrapped_rem(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

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

Panics

Panics if the divisor is zero.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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, FixedU64};
type Fix = FixedU64<U4>;
let _divisor_is_zero = Fix::from_num(1.5).unwrapped_rem(Fix::ZERO);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn unwrapped_mul_add<MulFrac: LeEqU64>(
    self,
    mul: FixedU64<MulFrac>,
    add: FixedU64<Frac>
) -> FixedU64<Frac>
[src]

Unwrapped multiply and add. Returns self × mul + add, panicking on 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, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(
    Fix::from_num(4).unwrapped_mul_add(Fix::from_num(0.5), Fix::from_num(3)),
    Fix::from_num(5)
);

The following panics because of overflow.

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn unwrapped_mul_int(self, rhs: u64) -> FixedU64<Frac>
[src]

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, FixedU64};
type Fix = FixedU64<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, FixedU64};
type Fix = FixedU64<U4>;
let _overflow = Fix::MAX.unwrapped_mul_int(4);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn unwrapped_div_int(self, rhs: u64) -> FixedU64<Frac>
[src]

Unwrapped division by an integer. Returns the quotient.

Can never overflow for unsigned values.

Panics

Panics if the divisor is zero.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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, FixedU64};
type Fix = FixedU64<U4>;
let _divisor_is_zero = Fix::from_num(3).unwrapped_div_int(0);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn unwrapped_rem_euclid(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

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

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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, FixedU64};
type Fix = FixedU64<U4>;
let _divisor_is_zero = Fix::from_num(3).unwrapped_rem_euclid(Fix::ZERO);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn unwrapped_shl(self, rhs: u32) -> FixedU64<Frac>
[src]

Unwrapped shift left. Panics if rhs ≥ 64.

Panics

Panics if rhs ≥ 64.

Examples

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

The following panics because of overflow.

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn unwrapped_shr(self, rhs: u32) -> FixedU64<Frac>
[src]

Unwrapped shift right. Panics if rhs ≥ 64.

Panics

Panics if rhs ≥ 64.

Examples

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

The following panics because of overflow.

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn unwrapped_dist(self, other: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Unwrapped distance. Returns the distance from self to other.

The distance is the absolute value of the difference.

Can never overflow for unsigned types.

Examples

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

pub fn unwrapped_next_power_of_two(self) -> FixedU64<Frac>[src]

Returns the smallest power of two that is ≥ self, panicking if the next power of two is too large to represent.

Panics

Panics if the result does not fit.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
// 3/8 is 0.0110
let three_eights = Fix::from_bits(0b0110);
// 1/2 is 0.1000
let half = Fix::from_bits(0b1000);
assert_eq!(three_eights.unwrapped_next_power_of_two(), half);

The following panics because of overflow.

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

pub const fn overflowing_neg(self) -> (FixedU64<Frac>, bool)[src]

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.

Only zero can be negated without overflow.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::ZERO.overflowing_neg(), (Fix::ZERO, false));
assert_eq!(Fix::from_num(5).overflowing_neg(), Fix::overflowing_from_num(-5));
let neg_five_bits = !Fix::from_num(5).to_bits() + 1;
assert_eq!(Fix::from_num(5).overflowing_neg(), (Fix::from_bits(neg_five_bits), true));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn overflowing_add(
    self,
    rhs: FixedU64<Frac>
) -> (FixedU64<Frac>, bool)
[src]

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, FixedU64};
type Fix = FixedU64<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), (one_minus_delta, true));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn overflowing_sub(
    self,
    rhs: FixedU64<Frac>
) -> (FixedU64<Frac>, bool)
[src]

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, FixedU64};
type Fix = FixedU64<U4>;
let one_minus_delta = Fix::ONE - Fix::DELTA;
assert_eq!(Fix::from_num(5).overflowing_sub(Fix::from_num(3)), (Fix::from_num(2), false));
assert_eq!(Fix::ZERO.overflowing_sub(Fix::ONE), (Fix::MAX - one_minus_delta, true));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn overflowing_mul_add<MulFrac: LeEqU64>(
    self,
    mul: FixedU64<MulFrac>,
    add: FixedU64<Frac>
) -> (FixedU64<Frac>, bool)
[src]

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.

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, FixedU64};
type Fix = FixedU64<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)
);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn overflowing_mul_int(self, rhs: u64) -> (FixedU64<Frac>, bool)
[src]

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, FixedU64};
type Fix = FixedU64<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));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn overflowing_div_int(self, rhs: u64) -> (FixedU64<Frac>, bool)
[src]

Overflowing division by an integer.

Returns a tuple of the quotient and false, as the division can never overflow for unsigned values.

Panics

Panics if the divisor is zero.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn overflowing_shl(self, rhs: u32) -> (FixedU64<Frac>, bool)
[src]

Overflowing shift left.

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

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn overflowing_shr(self, rhs: u32) -> (FixedU64<Frac>, bool)
[src]

Overflowing shift right.

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

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn overflowing_dist(
    self,
    other: FixedU64<Frac>
) -> (FixedU64<Frac>, bool)
[src]

Overflowing distance.

Returns a tuple of the distance from self to other and false, as overflow can never happen for unsigned types.

The distance is the absolute value of the difference.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(
    Fix::ONE.overflowing_dist(Fix::from_num(5)),
    (Fix::from_num(4), false)
);
assert_eq!(
    Fix::ZERO.overflowing_dist(Fix::MAX),
    (Fix::MAX, false)
);

impl<Frac: LeEqU64> FixedU64<Frac>[src]

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

pub const INT_NBITS: u32[src]

The number of integer bits.

Examples

use fixed::{types::extra::U6, FixedU64};
type Fix = FixedU64<U6>;
assert_eq!(Fix::INT_NBITS, 64 - 6);

pub const FRAC_NBITS: u32[src]

The number of fractional bits.

Examples

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

pub fn from_num<Src: ToFixed>(src: Src) -> FixedU64<Frac>[src]

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 F128Bits. 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, FixedU64};
type Fix = FixedU64<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)));

pub fn to_num<Dst: FromFixed>(self) -> Dst[src]

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 F128Bits. 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, FixedU64};
type Fix = FixedU64<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>(), 2);

// 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);

pub fn checked_from_num<Src: ToFixed>(src: Src) -> Option<FixedU64<Frac>>[src]

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 F128Bits. 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,
    FixedU64,
};
type Fix = FixedU64<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 = FixedU64::<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 = u64::MAX;
assert!(Fix::checked_from_num(too_large).is_none());
let too_small = -1;
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());

pub fn checked_to_num<Dst: FromFixed>(self) -> Option<Dst>[src]

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 F128Bits. 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,
    FixedU64,
};
type Fix = FixedU64<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 = FixedU64<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(2));
type AllInt = FixedU64<U0>;
assert!(AllInt::MAX.checked_to_num::<i64>().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));

pub fn saturating_from_num<Src: ToFixed>(src: Src) -> FixedU64<Frac>[src]

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 F128Bits. 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,
    FixedU64,
};
type Fix = FixedU64<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 = FixedU64::<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 = -1;
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);

pub fn saturating_to_num<Dst: FromFixed>(self) -> Dst[src]

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 F128Bits. 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,
    FixedU64,
};
type Fix = FixedU64<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 = FixedU64<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 = FixedU64<U0>;
assert_eq!(AllInt::MAX.saturating_to_num::<i64>(), i64::MAX);

// 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);

pub fn wrapping_from_num<Src: ToFixed>(src: Src) -> FixedU64<Frac>[src]

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 F128Bits. 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,
    FixedU64,
};
type Fix = FixedU64<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 << (64 - 7) will wrap to fixed-point 1010...
let too_large = FixedU64::<U0>::from_bits(0b1101 << (64 - 7));
let wrapped = Fix::from_bits(0b1010 << (64 - 4));
assert_eq!(Fix::wrapping_from_num(too_large), wrapped);

// integer 0b1101 << (64 - 7) will wrap to fixed-point 1010...
let large: u64 = 0b1101 << (64 - 7);
let wrapped = Fix::from_bits(0b1010 << (64 - 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 << (64 - 4) wraps to binary 11000...
let large = 1.75 * 2f32.powi(64 - 4);
let wrapped = Fix::from_bits(0b1100 << (64 - 4));
assert_eq!(Fix::wrapping_from_num(large), wrapped);

pub fn wrapping_to_num<Dst: FromFixed>(self) -> Dst[src]

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 F128Bits. 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,
    FixedU64,
};
type Fix = FixedU64<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 = FixedU64<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 = FixedU64<U0>;
assert_eq!(AllInt::MAX.wrapping_to_num::<i64>(), -1);

// 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);

pub fn unwrapped_from_num<Src: ToFixed>(src: Src) -> FixedU64<Frac>[src]

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 F128Bits. 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},
    FixedU64,
};
type Fix = FixedU64<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},
    FixedU64,
};
type Fix = FixedU64<U4>;
let too_large = FixedU64::<U0>::from_bits(0b1101 << (64 - 7));
let _overflow = Fix::unwrapped_from_num(too_large);

pub fn unwrapped_to_num<Dst: FromFixed>(self) -> Dst[src]

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 F128Bits. 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},
    FixedU64,
};
type Fix = FixedU64<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},
    FixedU64,
};
type Fix = FixedU64<U4>;
type TooFewIntBits = FixedU64<U6>;
let _overflow = Fix::MAX.unwrapped_to_num::<TooFewIntBits>();

pub fn overflowing_from_num<Src: ToFixed>(src: Src) -> (FixedU64<Frac>, bool)[src]

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 F128Bits. 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,
    FixedU64,
};
type Fix = FixedU64<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 << (64 - 7) will wrap to fixed-point 1010...
let too_large = FixedU64::<U0>::from_bits(0b1101 << (64 - 7));
let wrapped = Fix::from_bits(0b1010 << (64 - 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 << (64 - 7) will wrap to fixed-point 1010...
let large: u64 = 0b1101 << (64 - 7);
let wrapped = Fix::from_bits(0b1010 << (64 - 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 << (64 - 4) wraps to binary 11000...
let large = 1.75 * 2f32.powi(64 - 4);
let wrapped = Fix::from_bits(0b1100 << (64 - 4));
assert_eq!(Fix::overflowing_from_num(large), (wrapped, true));

pub fn overflowing_to_num<Dst: FromFixed>(self) -> (Dst, bool)[src]

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 F128Bits. 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,
    FixedU64,
};
type Fix = FixedU64<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 = FixedU64<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 = FixedU64::<U0>::MAX;
let wrapped = -1i64;
assert_eq!(does_not_fit.overflowing_to_num::<i64>(), (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));

pub fn from_str_binary(src: &str) -> Result<FixedU64<Frac>, ParseFixedError>[src]

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, FixedU64};
type Fix = FixedU64<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));

pub fn from_str_octal(src: &str) -> Result<FixedU64<Frac>, ParseFixedError>[src]

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, FixedU64};
type Fix = FixedU64<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));

pub fn from_str_hex(src: &str) -> Result<FixedU64<Frac>, ParseFixedError>[src]

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, FixedU64};
type Fix = FixedU64<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));

pub fn saturating_from_str(src: &str) -> Result<FixedU64<Frac>, ParseFixedError>[src]

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::U8F8;
assert_eq!(U8F8::saturating_from_str("9999"), Ok(U8F8::MAX));
assert_eq!(U8F8::saturating_from_str("-1"), Ok(U8F8::ZERO));

pub fn saturating_from_str_binary(
    src: &str
) -> Result<FixedU64<Frac>, ParseFixedError>
[src]

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::U8F8;
assert_eq!(U8F8::saturating_from_str_binary("101100111000"), Ok(U8F8::MAX));
assert_eq!(U8F8::saturating_from_str_binary("-1"), Ok(U8F8::ZERO));

pub fn saturating_from_str_octal(
    src: &str
) -> Result<FixedU64<Frac>, ParseFixedError>
[src]

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::U8F8;
assert_eq!(U8F8::saturating_from_str_octal("7777"), Ok(U8F8::MAX));
assert_eq!(U8F8::saturating_from_str_octal("-1"), Ok(U8F8::ZERO));

pub fn saturating_from_str_hex(
    src: &str
) -> Result<FixedU64<Frac>, ParseFixedError>
[src]

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::U8F8;
assert_eq!(U8F8::saturating_from_str_hex("FFFF"), Ok(U8F8::MAX));
assert_eq!(U8F8::saturating_from_str_hex("-1"), Ok(U8F8::ZERO));

pub fn wrapping_from_str(src: &str) -> Result<FixedU64<Frac>, ParseFixedError>[src]

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::U8F8;
// 9999.5 = 15.5 + 256 × n
assert_eq!(U8F8::wrapping_from_str("9999.5"), Ok(U8F8::from_num(15.5)));
assert_eq!(U8F8::wrapping_from_str("-9999.5"), Ok(U8F8::from_num(240.5)));

pub fn wrapping_from_str_binary(
    src: &str
) -> Result<FixedU64<Frac>, ParseFixedError>
[src]

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::U8F8;
let check = U8F8::from_bits(0b1110001 << (8 - 1));
assert_eq!(U8F8::wrapping_from_str_binary("101100111000.1"), Ok(check));
assert_eq!(U8F8::wrapping_from_str_binary("-101100111000.1"), Ok(check.wrapping_neg()));

pub fn wrapping_from_str_octal(
    src: &str
) -> Result<FixedU64<Frac>, ParseFixedError>
[src]

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::U8F8;
let check = U8F8::from_bits(0o1654 << (8 - 3));
assert_eq!(U8F8::wrapping_from_str_octal("7165.4"), Ok(check));
assert_eq!(U8F8::wrapping_from_str_octal("-7165.4"), Ok(check.wrapping_neg()));

pub fn wrapping_from_str_hex(
    src: &str
) -> Result<FixedU64<Frac>, ParseFixedError>
[src]

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::U8F8;
let check = U8F8::from_bits(0xFFE);
assert_eq!(U8F8::wrapping_from_str_hex("C0F.FE"), Ok(check));
assert_eq!(U8F8::wrapping_from_str_hex("-C0F.FE"), Ok(check.wrapping_neg()));

pub fn overflowing_from_str(
    src: &str
) -> Result<(FixedU64<Frac>, bool), ParseFixedError>
[src]

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::U8F8;
assert_eq!(U8F8::overflowing_from_str("99.5"), Ok((U8F8::from_num(99.5), false)));
// 9999.5 = 15.5 + 256 × n
assert_eq!(U8F8::overflowing_from_str("9999.5"), Ok((U8F8::from_num(15.5), true)));

pub fn overflowing_from_str_binary(
    src: &str
) -> Result<(FixedU64<Frac>, bool), ParseFixedError>
[src]

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::U8F8;
let check = U8F8::from_bits(0b1110001 << (8 - 1));
assert_eq!(U8F8::overflowing_from_str_binary("111000.1"), Ok((check, false)));
assert_eq!(U8F8::overflowing_from_str_binary("101100111000.1"), Ok((check, true)));

pub fn overflowing_from_str_octal(
    src: &str
) -> Result<(FixedU64<Frac>, bool), ParseFixedError>
[src]

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::U8F8;
let check = U8F8::from_bits(0o1654 << (8 - 3));
assert_eq!(U8F8::overflowing_from_str_octal("165.4"), Ok((check, false)));
assert_eq!(U8F8::overflowing_from_str_octal("7165.4"), Ok((check, true)));

pub fn overflowing_from_str_hex(
    src: &str
) -> Result<(FixedU64<Frac>, bool), ParseFixedError>
[src]

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::U8F8;
let check = U8F8::from_bits(0xFFE);
assert_eq!(U8F8::overflowing_from_str_hex("F.FE"), Ok((check, false)));
assert_eq!(U8F8::overflowing_from_str_hex("C0F.FE"), Ok((check, true)));

pub fn int(self) -> FixedU64<Frac>[src]

Returns the integer part.

Note that for unsigned numbers, this is equivalent to floor.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

pub fn frac(self) -> FixedU64<Frac>[src]

Returns the fractional part.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
// 0000.0100
let quarter = Fix::ONE / 4;
// 0010.0100
let two_and_quarter = quarter * 9;
assert_eq!(two_and_quarter.frac(), quarter);

pub fn round_to_zero(self) -> FixedU64<Frac>[src]

Rounds to the next integer towards 0.

Note that for unsigned numbers, this is equivalent to floor.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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));

pub fn ceil(self) -> FixedU64<Frac>[src]

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, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(2.5).ceil(), Fix::from_num(3));

pub fn floor(self) -> FixedU64<Frac>[src]

Rounds to the next integer towards −∞.

Examples

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

pub fn round(self) -> FixedU64<Frac>[src]

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, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(2.5).round(), Fix::from_num(3));

pub fn round_ties_to_even(self) -> FixedU64<Frac>[src]

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, FixedU64};
type Fix = FixedU64<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));

pub fn checked_ceil(self) -> Option<FixedU64<Frac>>[src]

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

Examples

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

pub fn checked_floor(self) -> Option<FixedU64<Frac>>[src]

Checked floor. Rounds to the next integer towards −∞.Always returns Some for unsigned values.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(2.5).checked_floor(), Some(Fix::from_num(2)));

pub fn checked_round(self) -> Option<FixedU64<Frac>>[src]

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

Examples

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

pub fn checked_round_ties_to_even(self) -> Option<FixedU64<Frac>>[src]

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

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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());

pub fn saturating_ceil(self) -> FixedU64<Frac>[src]

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

Examples

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

pub fn saturating_floor(self) -> FixedU64<Frac>[src]

Saturating floor. Rounds to the next integer towards −∞. Cannot overflow for unsigned values.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(2.5).saturating_floor(), Fix::from_num(2));

pub fn saturating_round(self) -> FixedU64<Frac>[src]

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

Examples

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

pub fn saturating_round_ties_to_even(self) -> FixedU64<Frac>[src]

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

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

pub fn wrapping_ceil(self) -> FixedU64<Frac>[src]

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

Examples

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

pub fn wrapping_floor(self) -> FixedU64<Frac>[src]

Wrapping floor. Rounds to the next integer towards −∞. Cannot overflow for unsigned values.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(2.5).wrapping_floor(), Fix::from_num(2));

pub fn wrapping_round(self) -> FixedU64<Frac>[src]

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, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(2.5).wrapping_round(), Fix::from_num(3));
assert_eq!(Fix::MAX.wrapping_round(), Fix::MIN);

pub fn wrapping_round_ties_to_even(self) -> FixedU64<Frac>[src]

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, FixedU64};
type Fix = FixedU64<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);

pub fn unwrapped_ceil(self) -> FixedU64<Frac>[src]

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, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(2.5).unwrapped_ceil(), Fix::from_num(3));

The following panics because of overflow.

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

pub fn unwrapped_floor(self) -> FixedU64<Frac>[src]

Unwrapped floor. Rounds to the next integer towards −∞. Cannot overflow for unsigned values.

Examples

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

pub fn unwrapped_round(self) -> FixedU64<Frac>[src]

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, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(2.5).unwrapped_round(), Fix::from_num(3));

The following panics because of overflow.

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

pub fn unwrapped_round_ties_to_even(self) -> FixedU64<Frac>[src]

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, FixedU64};
type Fix = FixedU64<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, FixedU64};
type Fix = FixedU64<U4>;
let _overflow = Fix::MAX.unwrapped_round_ties_to_even();

pub fn overflowing_ceil(self) -> (FixedU64<Frac>, bool)[src]

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, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(2.5).overflowing_ceil(), (Fix::from_num(3), false));
assert_eq!(Fix::MAX.overflowing_ceil(), (Fix::MIN, true));

pub fn overflowing_floor(self) -> (FixedU64<Frac>, bool)[src]

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

Returns a tuple of the fixed-point number and false.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(2.5).overflowing_floor(), (Fix::from_num(2), false));

pub fn overflowing_round(self) -> (FixedU64<Frac>, bool)[src]

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, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(2.5).overflowing_round(), (Fix::from_num(3), false));
assert_eq!(Fix::MAX.overflowing_round(), (Fix::MIN, true));

pub fn overflowing_round_ties_to_even(self) -> (FixedU64<Frac>, bool)[src]

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, FixedU64};
type Fix = FixedU64<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));

pub fn int_log2(self) -> i32[src]

Integer base-2 logarithm, rounded down.

Panics

Panics if the fixed-point number is zero.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

pub fn int_log10(self) -> i32[src]

Integer base-10 logarithm, rounded down.

Panics

Panics if the fixed-point number is zero.

Examples

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

pub fn checked_int_log2(self) -> Option<i32>[src]

Checked integer base-2 logarithm, rounded down. Returns the logarithm or None if the fixed-point number is zero.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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));

pub fn checked_int_log10(self) -> Option<i32>[src]

Checked integer base-10 logarithm, rounded down. Returns the logarithm or None if the fixed-point number is zero.

Examples

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

pub fn recip(self) -> FixedU64<Frac>[src]

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, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(2).recip(), Fix::from_num(0.5));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn div_euclid(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

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, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(7.5).div_euclid(Fix::from_num(2)), Fix::from_num(3));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn div_euclid_int(self, rhs: u64) -> FixedU64<Frac>
[src]

Euclidean division by an integer.

Panics

Panics if the divisor is zero.

Examples

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

pub fn mul_acc<AFrac: LeEqU64, BFrac: LeEqU64>(
    &mut self,
    a: FixedU64<AFrac>,
    b: FixedU64<BFrac>
)
[src]

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

The a and b parameters 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_acc instead.

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn rem_euclid_int(self, rhs: u64) -> FixedU64<Frac>
[src]

Remainder for Euclidean division by an integer.

Panics

Panics if the divisor is zero.

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn checked_mul(self, rhs: FixedU64<Frac>) -> Option<FixedU64<Frac>>
[src]

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

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn checked_div(self, rhs: FixedU64<Frac>) -> Option<FixedU64<Frac>>
[src]

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

Examples

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

pub fn checked_recip(self) -> Option<FixedU64<Frac>>[src]

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

Examples

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

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn checked_div_euclid(self, rhs: FixedU64<Frac>) -> Option<FixedU64<Frac>>
[src]

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

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this `Option` may be a `None` variant indicating overflow, which should be handled"]
pub fn checked_mul_acc<AFrac: LeEqU64, BFrac: LeEqU64>(
    &mut self,
    a: FixedU64<AFrac>,
    b: FixedU64<BFrac>
) -> Option<()>
[src]

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 (), this method wraps () into Some(()) on success.

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

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, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn checked_rem_int(self, rhs: u64) -> Option<FixedU64<Frac>>
[src]

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, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn checked_div_euclid_int(self, rhs: u64) -> Option<FixedU64<Frac>>
[src]

Checked Euclidean division by an integer. Returns the quotient, or None if the divisor is zero.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn checked_rem_euclid_int(self, rhs: u64) -> Option<FixedU64<Frac>>
[src]

Checked remainder for Euclidean division by an integer. Returns the remainder, or None if the divisor is zero.

Examples

use fixed::{types::extra::U60, FixedU64};
type Fix = FixedU64<U60>;
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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn saturating_mul(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Saturating multiplication. Returns the product, saturating on overflow.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn saturating_div(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Saturating division. Returns the quotient, saturating on overflow.

Panics

Panics if the divisor is zero.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

pub fn saturating_recip(self) -> FixedU64<Frac>[src]

Saturating reciprocal. Returns the reciprocal, saturating on overflow.

Panics

Panics if the fixed-point number is zero.

Examples

use fixed::{types::extra::U63, FixedU64};
// only one integer bit
type Fix = FixedU64<U63>;
assert_eq!(Fix::from_num(0.25).saturating_recip(), Fix::MAX);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn saturating_div_euclid(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

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

Panics

Panics if the divisor is zero.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn saturating_div_euclid_int(self, rhs: u64) -> FixedU64<Frac>
[src]

Saturating Euclidean division by an integer. Returns the quotient.

Can never overflow for unsigned values.

Panics

Panics if the divisor is zero.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(7.5).saturating_div_euclid_int(2), Fix::from_num(3));

pub fn saturating_mul_acc<AFrac: LeEqU64, BFrac: LeEqU64>(
    &mut self,
    a: FixedU64<AFrac>,
    b: FixedU64<BFrac>
)
[src]

Saturating multiply and accumulate. Adds (a × b) to self, saturating 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, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn saturating_rem_euclid_int(self, rhs: u64) -> FixedU64<Frac>
[src]

Saturating remainder for Euclidean division by an integer. Returns the remainder.

Can never overflow for unsigned values.

Panics

Panics if the divisor is zero.

Examples

use fixed::{types::extra::U60, FixedU64};
type Fix = FixedU64<U60>;
assert_eq!(Fix::from_num(7.5).saturating_rem_euclid_int(2), Fix::from_num(1.5));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn wrapping_mul(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Wrapping multiplication. Returns the product, wrapping on overflow.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn wrapping_div(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Wrapping division. Returns the quotient, wrapping on overflow.

Panics

Panics if the divisor is zero.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

pub fn wrapping_recip(self) -> FixedU64<Frac>[src]

Wrapping reciprocal. Returns the reciprocal, wrapping on overflow.

Panics

Panics if the fixed-point number is zero.

Examples

use fixed::{types::extra::U63, FixedU64};
// only one integer bit
type Fix = FixedU64<U63>;
assert_eq!(Fix::from_num(0.25).wrapping_recip(), Fix::ZERO);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn wrapping_div_euclid(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Wrapping Euclidean division. Returns the quotient, wrapping on overflow.

Panics

Panics if the divisor is zero.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn wrapping_div_euclid_int(self, rhs: u64) -> FixedU64<Frac>
[src]

Wrapping Euclidean division by an integer. Returns the quotient.

Can never overflow for unsigned values.

Panics

Panics if the divisor is zero.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(7.5).wrapping_div_euclid_int(2), Fix::from_num(3));

pub fn wrapping_mul_acc<AFrac: LeEqU64, BFrac: LeEqU64>(
    &mut self,
    a: FixedU64<AFrac>,
    b: FixedU64<BFrac>
)
[src]

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, FixedU64};
type Fix = FixedU64<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));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn wrapping_rem_euclid_int(self, rhs: u64) -> FixedU64<Frac>
[src]

Wrapping remainder for Euclidean division by an integer. Returns the remainder.

Can never overflow for unsigned values.

Panics

Panics if the divisor is zero.

Examples

use fixed::{types::extra::U60, FixedU64};
type Fix = FixedU64<U60>;
assert_eq!(Fix::from_num(7.5).wrapping_rem_euclid_int(2), Fix::from_num(1.5));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn unwrapped_mul(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

Unwrapped multiplication. Returns the product, panicking on overflow.

Panics

Panics if the result does not fit.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<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, FixedU64};
type Fix = FixedU64<U4>;
let _overflow = Fix::MAX.unwrapped_mul(Fix::from_num(4));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn unwrapped_div(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

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, FixedU64};
type Fix = FixedU64<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, FixedU64};
type Fix = FixedU64<U4>;
let quarter = Fix::ONE / 4;
let _overflow = Fix::MAX.unwrapped_div(quarter);

pub fn unwrapped_recip(self) -> FixedU64<Frac>[src]

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, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(0.25).unwrapped_recip(), Fix::from_num(4));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn unwrapped_div_euclid(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>
[src]

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, FixedU64};
type Fix = FixedU64<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, FixedU64};
type Fix = FixedU64<U4>;
let _overflow = Fix::MAX.unwrapped_div_euclid(Fix::from_num(0.25));

pub fn unwrapped_mul_acc<AFrac: LeEqU64, BFrac: LeEqU64>(
    &mut self,
    a: FixedU64<AFrac>,
    b: FixedU64<BFrac>
)
[src]

Unwrapped multiply and accumulate. Adds (a × b) to self, panicking on 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, FixedU64};
type Fix = FixedU64<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);

The following panics because of overflow.

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
let mut acc = Fix::DELTA;
acc.unwrapped_mul_acc(Fix::MAX, Fix::ONE);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn unwrapped_rem_int(self, rhs: u64) -> FixedU64<Frac>
[src]

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, FixedU64};
type Fix = FixedU64<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, FixedU64};
type Fix = FixedU64<U4>;
let _divisor_is_zero = Fix::from_num(3.75).unwrapped_rem_int(0);

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn unwrapped_div_euclid_int(self, rhs: u64) -> FixedU64<Frac>
[src]

Unwrapped Euclidean division by an integer. Returns the quotient.

Can never overflow for unsigned values.

Panics

Panics if the divisor is zero.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(7.5).unwrapped_div_euclid_int(2), Fix::from_num(3));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn unwrapped_rem_euclid_int(self, rhs: u64) -> FixedU64<Frac>
[src]

Unwrapped remainder for Euclidean division by an integer. Returns the remainder.

Can never overflow for unsigned values.

Panics

Panics if the divisor is zero.

Examples

use fixed::{types::extra::U60, FixedU64};
type Fix = FixedU64<U60>;
assert_eq!(Fix::from_num(7.5).unwrapped_rem_euclid_int(2), Fix::from_num(1.5));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn overflowing_mul(self, rhs: FixedU64<Frac>) -> (FixedU64<Frac>, bool)
[src]

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, FixedU64};
type Fix = FixedU64<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));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn overflowing_div(self, rhs: FixedU64<Frac>) -> (FixedU64<Frac>, bool)
[src]

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, FixedU64};
type Fix = FixedU64<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));

pub fn overflowing_recip(self) -> (FixedU64<Frac>, bool)[src]

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, U63},
    FixedU64,
};
type Fix = FixedU64<U4>;
// only one integer bit
type Small = FixedU64<U63>;
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));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn overflowing_div_euclid(
    self,
    rhs: FixedU64<Frac>
) -> (FixedU64<Frac>, bool)
[src]

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, FixedU64};
type Fix = FixedU64<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));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn overflowing_div_euclid_int(self, rhs: u64) -> (FixedU64<Frac>, bool)
[src]

Overflowing Euclidean division by an integer.

Returns a tuple of the quotient and false, as the division can never overflow for unsigned values.

Panics

Panics if the divisor is zero.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::from_num(7.5).overflowing_div_euclid_int(2), (Fix::from_num(3), false));

#[must_use = "this returns whether overflow occurs; use `wrapping_mul_acc` if the flag is not needed"]
pub fn overflowing_mul_acc<AFrac: LeEqU64, BFrac: LeEqU64>(
    &mut self,
    a: FixedU64<AFrac>,
    b: FixedU64<BFrac>
) -> bool
[src]

Overflowing multiply and accumulate. Adds (a × b) to self, wrapping and returning true if overflow occurs.

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, FixedU64};
type Fix = FixedU64<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));

#[must_use = "this returns the result of the operation, without modifying the original"]
pub fn overflowing_rem_euclid_int(self, rhs: u64) -> (FixedU64<Frac>, bool)
[src]

Remainder for Euclidean division by an integer.

Returns a tuple of the remainder and false, as this can never overflow for unsigned values.

Panics

Panics if the divisor is zero.

Examples

use fixed::{types::extra::U60, FixedU64};
type Fix = FixedU64<U60>;
assert_eq!(Fix::from_num(7.5).overflowing_rem_euclid_int(2), (Fix::from_num(1.5), false));

impl<Frac: LeEqU64> FixedU64<Frac>[src]

This block contains constants in the range 0 < x < 0.5.

Examples

use fixed::{consts, types::extra::U64, FixedU64};
type Fix = FixedU64<U64>;
assert_eq!(Fix::LOG10_2, Fix::from_num(consts::LOG10_2));

pub const FRAC_1_TAU: FixedU64<Frac>[src]

1/τ = 0.159154…

pub const FRAC_2_TAU: FixedU64<Frac>[src]

2/τ = 0.318309…

pub const FRAC_PI_8: FixedU64<Frac>[src]

π/8 = 0.392699…

pub const FRAC_1_PI: FixedU64<Frac>[src]

1/π = 0.318309…

pub const LOG10_2: FixedU64<Frac>[src]

log10 2 = 0.301029…

pub const LOG10_E: FixedU64<Frac>[src]

log10 e = 0.434294…

impl<Frac: Unsigned> FixedU64<Frac> where
    Frac: IsLessOrEqual<U64, Output = True>, 
[src]

This block contains constants in the range 0.5 ≤ x < 1.

Examples

use fixed::{consts, types::extra::U64, FixedU64};
type Fix = FixedU64<U64>;
assert_eq!(Fix::LN_2, Fix::from_num(consts::LN_2));
assert!(0.5 <= Fix::LN_2 && Fix::LN_2 < 1);

pub const FRAC_TAU_8: FixedU64<Frac>[src]

τ/8 = 0.785398…

pub const FRAC_TAU_12: FixedU64<Frac>[src]

τ/12 = 0.523598…

pub const FRAC_4_TAU: FixedU64<Frac>[src]

4/τ = 0.636619…

pub const FRAC_PI_4: FixedU64<Frac>[src]

π/4 = 0.785398…

pub const FRAC_PI_6: FixedU64<Frac>[src]

π/6 = 0.523598…

pub const FRAC_2_PI: FixedU64<Frac>[src]

2/π = 0.636619…

pub const FRAC_1_SQRT_PI: FixedU64<Frac>[src]

1/√π = 0.564189…

pub const FRAC_1_SQRT_2: FixedU64<Frac>[src]

1/√2 = 0.707106…

pub const FRAC_1_SQRT_3: FixedU64<Frac>[src]

1/√3 = 0.577350…

pub const LN_2: FixedU64<Frac>[src]

ln 2 = 0.693147…

pub const FRAC_1_PHI: FixedU64<Frac>[src]

The golden ratio conjugate, Φ = 1/φ = 0.618033…

pub const GAMMA: FixedU64<Frac>[src]

The Euler-Mascheroni constant, γ = 0.577215…

pub const CATALAN: FixedU64<Frac>[src]

Catalan’s constant = 0.915965…

impl<Frac: Unsigned> FixedU64<Frac> where
    Frac: IsLessOrEqual<U63, Output = True>, 
[src]

This block contains constants in the range 1 ≤ x < 2.

These constants are not representable in unsigned fixed-point numbers with less than 1 integer bit.

Examples

use fixed::{consts, types::extra::U63, FixedU64};
type Fix = FixedU64<U63>;
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 64 fractional bits and 0 integer bits is < 1.

use fixed::{consts, types::extra::U64, FixedU64};
type Fix = FixedU64<U64>;
let _ = Fix::LOG2_E;

pub const ONE: FixedU64<Frac>[src]

One.

Examples

use fixed::{types::extra::U4, FixedU64};
type Fix = FixedU64<U4>;
assert_eq!(Fix::ONE, Fix::from_num(1));

pub const FRAC_TAU_4: FixedU64<Frac>[src]

τ/4 = 1.57079…

pub const FRAC_TAU_6: FixedU64<Frac>[src]

τ/6 = 1.04719…

pub const FRAC_PI_2: FixedU64<Frac>[src]

π/2 = 1.57079…

pub const FRAC_PI_3: FixedU64<Frac>[src]

π/3 = 1.04719…

pub const SQRT_PI: FixedU64<Frac>[src]

√π = 1.77245…

pub const FRAC_2_SQRT_PI: FixedU64<Frac>[src]

2/√π = 1.12837…

pub const SQRT_2: FixedU64<Frac>[src]

√2 = 1.41421…

pub const SQRT_3: FixedU64<Frac>[src]

√3 = 1.73205…

pub const SQRT_E: FixedU64<Frac>[src]

√e = 1.64872…

pub const LOG2_E: FixedU64<Frac>[src]

log2 e = 1.44269…

pub const PHI: FixedU64<Frac>[src]

The golden ratio, φ = 1.61803…

pub const SQRT_PHI: FixedU64<Frac>[src]

√φ = 1.27201…

impl<Frac: Unsigned> FixedU64<Frac> where
    Frac: IsLessOrEqual<U62, Output = True>, 
[src]

This block contains constants in the range 2 ≤ x < 4.

These constants are not representable in unsigned fixed-point numbers with less than 2 integer bits.

Examples

use fixed::{consts, types::extra::U62, FixedU64};
type Fix = FixedU64<U62>;
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 63 fractional bits and 1 integer bit is < 2.

use fixed::{consts, types::extra::U63, FixedU64};
type Fix = FixedU64<U63>;
let _ = Fix::E;

pub const FRAC_TAU_2: FixedU64<Frac>[src]

τ/2 = 3.14159…

pub const FRAC_TAU_3: FixedU64<Frac>[src]

τ/3 = 2.09439…

pub const PI: FixedU64<Frac>[src]

Archimedes’ constant, π = 3.14159…

pub const E: FixedU64<Frac>[src]

Euler’s number, e = 2.71828…

pub const LOG2_10: FixedU64<Frac>[src]

log2 10 = 3.32192…

pub const LN_10: FixedU64<Frac>[src]

ln 10 = 2.30258…

impl<Frac: Unsigned> FixedU64<Frac> where
    Frac: IsLessOrEqual<U61, Output = True>, 
[src]

This block contains constants in the range 4 ≤ x < 8.

These constants are not representable in unsigned fixed-point numbers with less than 3 integer bits.

Examples

use fixed::{consts, types::extra::U61, FixedU64};
type Fix = FixedU64<U61>;
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 62 fractional bits and 2 integer bits is < 4.

use fixed::{consts, types::extra::U62, FixedU64};
type Fix = FixedU64<U62>;
let _ = Fix::TAU;

pub const TAU: FixedU64<Frac>[src]

A turn, τ = 6.28318…

Trait Implementations

impl<Frac> Add<&'_ FixedU64<Frac>> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the + operator.

fn add(self, rhs: &FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the + operation. Read more

impl<Frac> Add<&'_ FixedU64<Frac>> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the + operator.

fn add(self, rhs: &FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the + operation. Read more

impl<Frac> Add<FixedU64<Frac>> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the + operator.

fn add(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the + operation. Read more

impl<Frac> Add<FixedU64<Frac>> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the + operator.

fn add(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the + operation. Read more

impl<Frac> AddAssign<&'_ FixedU64<Frac>> for FixedU64<Frac>[src]

fn add_assign(&mut self, rhs: &FixedU64<Frac>)[src]

Performs the += operation. Read more

impl<Frac> AddAssign<FixedU64<Frac>> for FixedU64<Frac>[src]

fn add_assign(&mut self, rhs: FixedU64<Frac>)[src]

Performs the += operation. Read more

impl<Frac: LeEqU64> Binary for FixedU64<Frac>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult[src]

Formats the value using the given formatter.

impl<Frac> BitAnd<&'_ FixedU64<Frac>> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the & operator.

fn bitand(self, rhs: &FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the & operation. Read more

impl<Frac> BitAnd<&'_ FixedU64<Frac>> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the & operator.

fn bitand(self, rhs: &FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the & operation. Read more

impl<Frac> BitAnd<FixedU64<Frac>> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the & operator.

fn bitand(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the & operation. Read more

impl<Frac> BitAnd<FixedU64<Frac>> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the & operator.

fn bitand(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the & operation. Read more

impl<Frac> BitAndAssign<&'_ FixedU64<Frac>> for FixedU64<Frac>[src]

fn bitand_assign(&mut self, rhs: &FixedU64<Frac>)[src]

Performs the &= operation. Read more

impl<Frac> BitAndAssign<FixedU64<Frac>> for FixedU64<Frac>[src]

fn bitand_assign(&mut self, rhs: FixedU64<Frac>)[src]

Performs the &= operation. Read more

impl<Frac> BitOr<&'_ FixedU64<Frac>> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the | operator.

fn bitor(self, rhs: &FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the | operation. Read more

impl<Frac> BitOr<&'_ FixedU64<Frac>> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the | operator.

fn bitor(self, rhs: &FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the | operation. Read more

impl<Frac> BitOr<FixedU64<Frac>> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the | operator.

fn bitor(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the | operation. Read more

impl<Frac> BitOr<FixedU64<Frac>> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the | operator.

fn bitor(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the | operation. Read more

impl<Frac> BitOrAssign<&'_ FixedU64<Frac>> for FixedU64<Frac>[src]

fn bitor_assign(&mut self, rhs: &FixedU64<Frac>)[src]

Performs the |= operation. Read more

impl<Frac> BitOrAssign<FixedU64<Frac>> for FixedU64<Frac>[src]

fn bitor_assign(&mut self, rhs: FixedU64<Frac>)[src]

Performs the |= operation. Read more

impl<Frac> BitXor<&'_ FixedU64<Frac>> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the ^ operator.

fn bitxor(self, rhs: &FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the ^ operation. Read more

impl<Frac> BitXor<&'_ FixedU64<Frac>> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the ^ operator.

fn bitxor(self, rhs: &FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the ^ operation. Read more

impl<Frac> BitXor<FixedU64<Frac>> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the ^ operator.

fn bitxor(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the ^ operation. Read more

impl<Frac> BitXor<FixedU64<Frac>> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the ^ operator.

fn bitxor(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the ^ operation. Read more

impl<Frac> BitXorAssign<&'_ FixedU64<Frac>> for FixedU64<Frac>[src]

fn bitxor_assign(&mut self, rhs: &FixedU64<Frac>)[src]

Performs the ^= operation. Read more

impl<Frac> BitXorAssign<FixedU64<Frac>> for FixedU64<Frac>[src]

fn bitxor_assign(&mut self, rhs: FixedU64<Frac>)[src]

Performs the ^= operation. Read more

impl<Frac> Bounded for FixedU64<Frac>[src]

fn min_value() -> Self[src]

returns the smallest finite number this type can represent

fn max_value() -> Self[src]

returns the largest finite number this type can represent

impl<Frac: LeEqU64> Cast<F128Bits> for FixedU64<Frac>[src]

fn cast(self) -> F128Bits[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU128> Cast<FixedI128<FracDst>> for FixedU64<FracSrc>[src]

fn cast(self) -> FixedI128<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU16> Cast<FixedI16<FracDst>> for FixedU64<FracSrc>[src]

fn cast(self) -> FixedI16<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU32> Cast<FixedI32<FracDst>> for FixedU64<FracSrc>[src]

fn cast(self) -> FixedI32<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> Cast<FixedI64<FracDst>> for FixedU64<FracSrc>[src]

fn cast(self) -> FixedI64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU8> Cast<FixedI8<FracDst>> for FixedU64<FracSrc>[src]

fn cast(self) -> FixedI8<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU128> Cast<FixedU128<FracDst>> for FixedU64<FracSrc>[src]

fn cast(self) -> FixedU128<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU16> Cast<FixedU16<FracDst>> for FixedU64<FracSrc>[src]

fn cast(self) -> FixedU16<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU32> Cast<FixedU32<FracDst>> for FixedU64<FracSrc>[src]

fn cast(self) -> FixedU32<FracDst>[src]

Casts the value.

impl<Frac: LeEqU64> Cast<FixedU64<Frac>> for F128Bits[src]

fn cast(self) -> FixedU64<Frac>[src]

Casts the value.

impl<FracSrc: LeEqU8, FracDst: LeEqU64> Cast<FixedU64<FracDst>> for FixedI8<FracSrc>[src]

fn cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU16, FracDst: LeEqU64> Cast<FixedU64<FracDst>> for FixedI16<FracSrc>[src]

fn cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU32, FracDst: LeEqU64> Cast<FixedU64<FracDst>> for FixedI32<FracSrc>[src]

fn cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> Cast<FixedU64<FracDst>> for FixedI64<FracSrc>[src]

fn cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU128, FracDst: LeEqU64> Cast<FixedU64<FracDst>> for FixedI128<FracSrc>[src]

fn cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU8, FracDst: LeEqU64> Cast<FixedU64<FracDst>> for FixedU8<FracSrc>[src]

fn cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU16, FracDst: LeEqU64> Cast<FixedU64<FracDst>> for FixedU16<FracSrc>[src]

fn cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU32, FracDst: LeEqU64> Cast<FixedU64<FracDst>> for FixedU32<FracSrc>[src]

fn cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> Cast<FixedU64<FracDst>> for FixedU64<FracSrc>[src]

fn cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU128, FracDst: LeEqU64> Cast<FixedU64<FracDst>> for FixedU128<FracSrc>[src]

fn cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU8> Cast<FixedU8<FracDst>> for FixedU64<FracSrc>[src]

fn cast(self) -> FixedU8<FracDst>[src]

Casts the value.

impl<Frac: LeEqU64> Cast<bf16> for FixedU64<Frac>[src]

fn cast(self) -> bf16[src]

Casts the value.

impl<Frac: LeEqU64> Cast<f16> for FixedU64<Frac>[src]

fn cast(self) -> f16[src]

Casts the value.

impl<Frac: LeEqU64> Cast<f32> for FixedU64<Frac>[src]

fn cast(self) -> f32[src]

Casts the value.

impl<Frac: LeEqU64> Cast<f64> for FixedU64<Frac>[src]

fn cast(self) -> f64[src]

Casts the value.

impl<Frac: LeEqU64> Cast<i128> for FixedU64<Frac>[src]

fn cast(self) -> i128[src]

Casts the value.

impl<Frac: LeEqU64> Cast<i16> for FixedU64<Frac>[src]

fn cast(self) -> i16[src]

Casts the value.

impl<Frac: LeEqU64> Cast<i32> for FixedU64<Frac>[src]

fn cast(self) -> i32[src]

Casts the value.

impl<Frac: LeEqU64> Cast<i64> for FixedU64<Frac>[src]

fn cast(self) -> i64[src]

Casts the value.

impl<Frac: LeEqU64> Cast<i8> for FixedU64<Frac>[src]

fn cast(self) -> i8[src]

Casts the value.

impl<Frac: LeEqU64> Cast<isize> for FixedU64<Frac>[src]

fn cast(self) -> isize[src]

Casts the value.

impl<Frac: LeEqU64> Cast<u128> for FixedU64<Frac>[src]

fn cast(self) -> u128[src]

Casts the value.

impl<Frac: LeEqU64> Cast<u16> for FixedU64<Frac>[src]

fn cast(self) -> u16[src]

Casts the value.

impl<Frac: LeEqU64> Cast<u32> for FixedU64<Frac>[src]

fn cast(self) -> u32[src]

Casts the value.

impl<Frac: LeEqU64> Cast<u64> for FixedU64<Frac>[src]

fn cast(self) -> u64[src]

Casts the value.

impl<Frac: LeEqU64> Cast<u8> for FixedU64<Frac>[src]

fn cast(self) -> u8[src]

Casts the value.

impl<Frac: LeEqU64> Cast<usize> for FixedU64<Frac>[src]

fn cast(self) -> usize[src]

Casts the value.

impl<Frac> CheckedAdd for FixedU64<Frac>[src]

fn checked_add(&self, v: &Self) -> Option<Self>[src]

Adds two numbers, checking for overflow. If overflow happens, None is returned. Read more

impl<Frac: LeEqU64> CheckedCast<F128Bits> for FixedU64<Frac>[src]

fn checked_cast(self) -> Option<F128Bits>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU128> CheckedCast<FixedI128<FracDst>> for FixedU64<FracSrc>[src]

fn checked_cast(self) -> Option<FixedI128<FracDst>>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU16> CheckedCast<FixedI16<FracDst>> for FixedU64<FracSrc>[src]

fn checked_cast(self) -> Option<FixedI16<FracDst>>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU32> CheckedCast<FixedI32<FracDst>> for FixedU64<FracSrc>[src]

fn checked_cast(self) -> Option<FixedI32<FracDst>>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> CheckedCast<FixedI64<FracDst>> for FixedU64<FracSrc>[src]

fn checked_cast(self) -> Option<FixedI64<FracDst>>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU8> CheckedCast<FixedI8<FracDst>> for FixedU64<FracSrc>[src]

fn checked_cast(self) -> Option<FixedI8<FracDst>>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU128> CheckedCast<FixedU128<FracDst>> for FixedU64<FracSrc>[src]

fn checked_cast(self) -> Option<FixedU128<FracDst>>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU16> CheckedCast<FixedU16<FracDst>> for FixedU64<FracSrc>[src]

fn checked_cast(self) -> Option<FixedU16<FracDst>>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU32> CheckedCast<FixedU32<FracDst>> for FixedU64<FracSrc>[src]

fn checked_cast(self) -> Option<FixedU32<FracDst>>[src]

Casts the value.

impl<Frac: LeEqU64> CheckedCast<FixedU64<Frac>> for F128Bits[src]

fn checked_cast(self) -> Option<FixedU64<Frac>>[src]

Casts the value.

impl<FracSrc: LeEqU8, FracDst: LeEqU64> CheckedCast<FixedU64<FracDst>> for FixedI8<FracSrc>[src]

fn checked_cast(self) -> Option<FixedU64<FracDst>>[src]

Casts the value.

impl<FracSrc: LeEqU16, FracDst: LeEqU64> CheckedCast<FixedU64<FracDst>> for FixedI16<FracSrc>[src]

fn checked_cast(self) -> Option<FixedU64<FracDst>>[src]

Casts the value.

impl<FracSrc: LeEqU32, FracDst: LeEqU64> CheckedCast<FixedU64<FracDst>> for FixedI32<FracSrc>[src]

fn checked_cast(self) -> Option<FixedU64<FracDst>>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> CheckedCast<FixedU64<FracDst>> for FixedI64<FracSrc>[src]

fn checked_cast(self) -> Option<FixedU64<FracDst>>[src]

Casts the value.

impl<FracSrc: LeEqU128, FracDst: LeEqU64> CheckedCast<FixedU64<FracDst>> for FixedI128<FracSrc>[src]

fn checked_cast(self) -> Option<FixedU64<FracDst>>[src]

Casts the value.

impl<FracSrc: LeEqU8, FracDst: LeEqU64> CheckedCast<FixedU64<FracDst>> for FixedU8<FracSrc>[src]

fn checked_cast(self) -> Option<FixedU64<FracDst>>[src]

Casts the value.

impl<FracSrc: LeEqU16, FracDst: LeEqU64> CheckedCast<FixedU64<FracDst>> for FixedU16<FracSrc>[src]

fn checked_cast(self) -> Option<FixedU64<FracDst>>[src]

Casts the value.

impl<FracSrc: LeEqU32, FracDst: LeEqU64> CheckedCast<FixedU64<FracDst>> for FixedU32<FracSrc>[src]

fn checked_cast(self) -> Option<FixedU64<FracDst>>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> CheckedCast<FixedU64<FracDst>> for FixedU64<FracSrc>[src]

fn checked_cast(self) -> Option<FixedU64<FracDst>>[src]

Casts the value.

impl<FracSrc: LeEqU128, FracDst: LeEqU64> CheckedCast<FixedU64<FracDst>> for FixedU128<FracSrc>[src]

fn checked_cast(self) -> Option<FixedU64<FracDst>>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU8> CheckedCast<FixedU8<FracDst>> for FixedU64<FracSrc>[src]

fn checked_cast(self) -> Option<FixedU8<FracDst>>[src]

Casts the value.

impl<Frac: LeEqU64> CheckedCast<bf16> for FixedU64<Frac>[src]

fn checked_cast(self) -> Option<bf16>[src]

Casts the value.

impl<Frac: LeEqU64> CheckedCast<f16> for FixedU64<Frac>[src]

fn checked_cast(self) -> Option<f16>[src]

Casts the value.

impl<Frac: LeEqU64> CheckedCast<f32> for FixedU64<Frac>[src]

fn checked_cast(self) -> Option<f32>[src]

Casts the value.

impl<Frac: LeEqU64> CheckedCast<f64> for FixedU64<Frac>[src]

fn checked_cast(self) -> Option<f64>[src]

Casts the value.

impl<Frac: LeEqU64> CheckedCast<i128> for FixedU64<Frac>[src]

fn checked_cast(self) -> Option<i128>[src]

Casts the value.

impl<Frac: LeEqU64> CheckedCast<i16> for FixedU64<Frac>[src]

fn checked_cast(self) -> Option<i16>[src]

Casts the value.

impl<Frac: LeEqU64> CheckedCast<i32> for FixedU64<Frac>[src]

fn checked_cast(self) -> Option<i32>[src]

Casts the value.

impl<Frac: LeEqU64> CheckedCast<i64> for FixedU64<Frac>[src]

fn checked_cast(self) -> Option<i64>[src]

Casts the value.

impl<Frac: LeEqU64> CheckedCast<i8> for FixedU64<Frac>[src]

fn checked_cast(self) -> Option<i8>[src]

Casts the value.

impl<Frac: LeEqU64> CheckedCast<isize> for FixedU64<Frac>[src]

fn checked_cast(self) -> Option<isize>[src]

Casts the value.

impl<Frac: LeEqU64> CheckedCast<u128> for FixedU64<Frac>[src]

fn checked_cast(self) -> Option<u128>[src]

Casts the value.

impl<Frac: LeEqU64> CheckedCast<u16> for FixedU64<Frac>[src]

fn checked_cast(self) -> Option<u16>[src]

Casts the value.

impl<Frac: LeEqU64> CheckedCast<u32> for FixedU64<Frac>[src]

fn checked_cast(self) -> Option<u32>[src]

Casts the value.

impl<Frac: LeEqU64> CheckedCast<u64> for FixedU64<Frac>[src]

fn checked_cast(self) -> Option<u64>[src]

Casts the value.

impl<Frac: LeEqU64> CheckedCast<u8> for FixedU64<Frac>[src]

fn checked_cast(self) -> Option<u8>[src]

Casts the value.

impl<Frac: LeEqU64> CheckedCast<usize> for FixedU64<Frac>[src]

fn checked_cast(self) -> Option<usize>[src]

Casts the value.

impl<Frac: LeEqU64> CheckedDiv for FixedU64<Frac>[src]

fn checked_div(&self, v: &Self) -> Option<Self>[src]

Divides two numbers, checking for underflow, overflow and division by zero. If any of that happens, None is returned. Read more

impl<Frac: LeEqU64> CheckedMul for FixedU64<Frac>[src]

fn checked_mul(&self, v: &Self) -> Option<Self>[src]

Multiplies two numbers, checking for underflow or overflow. If underflow or overflow happens, None is returned. Read more

impl<Frac> CheckedNeg for FixedU64<Frac>[src]

fn checked_neg(&self) -> Option<Self>[src]

Negates a number, returning None for results that can’t be represented, like signed MIN values that can’t be positive, or non-zero unsigned values that can’t be negative. Read more

impl<Frac> CheckedRem for FixedU64<Frac>[src]

fn checked_rem(&self, v: &Self) -> Option<Self>[src]

Finds the remainder of dividing two numbers, checking for underflow, overflow and division by zero. If any of that happens, None is returned. Read more

impl<Frac> CheckedShl for FixedU64<Frac>[src]

fn checked_shl(&self, rhs: u32) -> Option<Self>[src]

Checked shift left. Computes self << rhs, returning None if rhs is larger than or equal to the number of bits in self. Read more

impl<Frac> CheckedShr for FixedU64<Frac>[src]

fn checked_shr(&self, rhs: u32) -> Option<Self>[src]

Checked shift right. Computes self >> rhs, returning None if rhs is larger than or equal to the number of bits in self. Read more

impl<Frac> CheckedSub for FixedU64<Frac>[src]

fn checked_sub(&self, v: &Self) -> Option<Self>[src]

Subtracts two numbers, checking for underflow. If underflow happens, None is returned. Read more

impl<Frac> Clone for FixedU64<Frac>[src]

fn clone(&self) -> FixedU64<Frac>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<Frac: LeEqU64> Debug for FixedU64<Frac>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult[src]

Formats the value using the given formatter. Read more

impl<Frac> Default for FixedU64<Frac>[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl<'de, Frac: LeEqU64> Deserialize<'de> for FixedU64<Frac>[src]

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>[src]

Deserialize this value from the given Serde deserializer. Read more

impl<Frac: LeEqU64> Display for FixedU64<Frac>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult[src]

Formats the value using the given formatter. Read more

impl<Frac: LeEqU64> Div<&'_ FixedU64<Frac>> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the / operator.

fn div(self, rhs: &FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the / operation. Read more

impl<Frac: LeEqU64> Div<&'_ FixedU64<Frac>> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the / operator.

fn div(self, rhs: &FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the / operation. Read more

impl<Frac: LeEqU64> Div<&'_ u64> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the / operator.

fn div(self, rhs: &u64) -> FixedU64<Frac>[src]

Performs the / operation. Read more

impl<Frac: LeEqU64> Div<&'_ u64> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the / operator.

fn div(self, rhs: &u64) -> FixedU64<Frac>[src]

Performs the / operation. Read more

impl<Frac: LeEqU64> Div<FixedU64<Frac>> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the / operator.

fn div(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the / operation. Read more

impl<Frac: LeEqU64> Div<FixedU64<Frac>> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the / operator.

fn div(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the / operation. Read more

impl<Frac: LeEqU64> Div<u64> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the / operator.

fn div(self, rhs: u64) -> FixedU64<Frac>[src]

Performs the / operation. Read more

impl<Frac: LeEqU64> Div<u64> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the / operator.

fn div(self, rhs: u64) -> FixedU64<Frac>[src]

Performs the / operation. Read more

impl<Frac: LeEqU64> DivAssign<&'_ FixedU64<Frac>> for FixedU64<Frac>[src]

fn div_assign(&mut self, rhs: &FixedU64<Frac>)[src]

Performs the /= operation. Read more

impl<Frac: LeEqU64> DivAssign<&'_ u64> for FixedU64<Frac>[src]

fn div_assign(&mut self, rhs: &u64)[src]

Performs the /= operation. Read more

impl<Frac: LeEqU64> DivAssign<FixedU64<Frac>> for FixedU64<Frac>[src]

fn div_assign(&mut self, rhs: FixedU64<Frac>)[src]

Performs the /= operation. Read more

impl<Frac: LeEqU64> DivAssign<u64> for FixedU64<Frac>[src]

fn div_assign(&mut self, rhs: u64)[src]

Performs the /= operation. Read more

impl<Frac: LeEqU64> Fixed for FixedU64<Frac>[src]

type Bits = u64

The primitive integer underlying type. Read more

type Bytes = [u8; 8]

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 = FixedI64<Frac>

An unsigned fixed-point number type with the same number of integer and fractional bits as Self. Read more

type Unsigned = FixedU64<Frac>

An unsigned fixed-point number type with the same number of integer and fractional bits as Self. Read more

const ZERO: Self[src]

Zero. Read more

const DELTA: Self[src]

The difference between any two successive representable numbers, Δ. Read more

const MIN: Self[src]

The smallest value that can be represented. Read more

const MAX: Self[src]

The largest value that can be represented. Read more

const IS_SIGNED: bool[src]

true if the type is signed. Read more

const INT_NBITS: u32[src]

The number of integer bits. Read more

const FRAC_NBITS: u32[src]

The number of fractional bits. Read more

fn from_bits(bits: Self::Bits) -> Self[src]

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

fn to_bits(self) -> Self::Bits[src]

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

fn from_be(fixed: Self) -> Self[src]

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

fn from_le(fixed: Self) -> Self[src]

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

fn to_be(self) -> Self[src]

Converts this fixed-point number to big endian from the target’s endianness. Read more

fn to_le(self) -> Self[src]

Converts this fixed-point number to little endian from the target’s endianness. Read more

fn swap_bytes(self) -> Self[src]

Reverses the byte order of the fixed-point number. Read more

fn from_be_bytes(bits: Self::Bytes) -> Self[src]

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

fn from_le_bytes(bits: Self::Bytes) -> Self[src]

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

fn from_ne_bytes(bits: Self::Bytes) -> Self[src]

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

fn to_be_bytes(self) -> Self::Bytes[src]

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

fn to_le_bytes(self) -> Self::Bytes[src]

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

fn to_ne_bytes(self) -> Self::Bytes[src]

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

fn from_num<Src: ToFixed>(src: Src) -> Self[src]

Creates a fixed-point number from another number. Read more

fn to_num<Dst: FromFixed>(self) -> Dst[src]

Converts a fixed-point number to another number. Read more

fn checked_from_num<Src: ToFixed>(val: Src) -> Option<Self>[src]

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

fn checked_to_num<Dst: FromFixed>(self) -> Option<Dst>[src]

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

fn saturating_from_num<Src: ToFixed>(val: Src) -> Self[src]

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

fn saturating_to_num<Dst: FromFixed>(self) -> Dst[src]

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

fn wrapping_from_num<Src: ToFixed>(val: Src) -> Self[src]

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

fn wrapping_to_num<Dst: FromFixed>(self) -> Dst[src]

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

fn unwrapped_from_num<Src: ToFixed>(val: Src) -> Self[src]

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

fn unwrapped_to_num<Dst: FromFixed>(self) -> Dst[src]

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

fn overflowing_from_num<Src: ToFixed>(val: Src) -> (Self, bool)[src]

Creates a fixed-point number from another number. Read more

fn overflowing_to_num<Dst: FromFixed>(self) -> (Dst, bool)[src]

Converts a fixed-point number to another number. Read more

fn from_str_binary(src: &str) -> Result<Self, ParseFixedError>[src]

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

fn from_str_octal(src: &str) -> Result<Self, ParseFixedError>[src]

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

fn from_str_hex(src: &str) -> Result<Self, ParseFixedError>[src]

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

fn saturating_from_str(src: &str) -> Result<Self, ParseFixedError>[src]

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

fn saturating_from_str_binary(src: &str) -> Result<Self, ParseFixedError>[src]

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

fn saturating_from_str_octal(src: &str) -> Result<Self, ParseFixedError>[src]

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

fn saturating_from_str_hex(src: &str) -> Result<Self, ParseFixedError>[src]

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

fn wrapping_from_str(src: &str) -> Result<Self, ParseFixedError>[src]

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

fn wrapping_from_str_binary(src: &str) -> Result<Self, ParseFixedError>[src]

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

fn wrapping_from_str_octal(src: &str) -> Result<Self, ParseFixedError>[src]

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

fn wrapping_from_str_hex(src: &str) -> Result<Self, ParseFixedError>[src]

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

fn overflowing_from_str(src: &str) -> Result<(Self, bool), ParseFixedError>[src]

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

fn overflowing_from_str_binary(
    src: &str
) -> Result<(Self, bool), ParseFixedError>
[src]

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

fn overflowing_from_str_octal(
    src: &str
) -> Result<(Self, bool), ParseFixedError>
[src]

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

fn overflowing_from_str_hex(src: &str) -> Result<(Self, bool), ParseFixedError>[src]

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

fn int(self) -> Self[src]

Returns the integer part. Read more

fn frac(self) -> Self[src]

Returns the fractional part. Read more

fn ceil(self) -> Self[src]

Rounds to the next integer towards +∞. Read more

fn floor(self) -> Self[src]

Rounds to the next integer towards −∞. Read more

fn round_to_zero(self) -> Self[src]

Rounds to the next integer towards 0. Read more

fn round(self) -> Self[src]

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

fn round_ties_to_even(self) -> Self[src]

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

fn checked_ceil(self) -> Option<Self>[src]

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

fn checked_floor(self) -> Option<Self>[src]

Checked floor. Rounds to the next integer towards −∞, returning None on overflow. Read more

fn checked_round(self) -> Option<Self>[src]

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

fn checked_round_ties_to_even(self) -> Option<Self>[src]

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

fn saturating_ceil(self) -> Self[src]

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

fn saturating_floor(self) -> Self[src]

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

fn saturating_round(self) -> Self[src]

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

fn saturating_round_ties_to_even(self) -> Self[src]

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

fn wrapping_ceil(self) -> Self[src]

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

fn wrapping_floor(self) -> Self[src]

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

fn wrapping_round(self) -> Self[src]

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

fn wrapping_round_ties_to_even(self) -> Self[src]

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

fn unwrapped_ceil(self) -> Self[src]

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

fn unwrapped_floor(self) -> Self[src]

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

fn unwrapped_round(self) -> Self[src]

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

fn unwrapped_round_ties_to_even(self) -> Self[src]

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

fn overflowing_ceil(self) -> (Self, bool)[src]

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

fn overflowing_floor(self) -> (Self, bool)[src]

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

fn overflowing_round(self) -> (Self, bool)[src]

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

fn overflowing_round_ties_to_even(self) -> (Self, bool)[src]

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

fn count_ones(self) -> u32[src]

Returns the number of ones in the binary representation. Read more

fn count_zeros(self) -> u32[src]

Returns the number of zeros in the binary representation. Read more

fn leading_ones(self) -> u32[src]

Returns the number of leading ones in the binary representation. Read more

fn leading_zeros(self) -> u32[src]

Returns the number of leading zeros in the binary representation. Read more

fn trailing_ones(self) -> u32[src]

Returns the number of trailing ones in the binary representation. Read more

fn trailing_zeros(self) -> u32[src]

Returns the number of trailing zeros in the binary representation. Read more

fn int_log2(self) -> i32[src]

Integer base-2 logarithm, rounded down. Read more

fn int_log10(self) -> i32[src]

Integer base-10 logarithm, rounded down. Read more

fn checked_int_log2(self) -> Option<i32>[src]

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

fn checked_int_log10(self) -> Option<i32>[src]

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

fn reverse_bits(self) -> Self[src]

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

fn rotate_left(self, n: u32) -> Self[src]

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

fn rotate_right(self, n: u32) -> Self[src]

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

fn is_zero(self) -> bool[src]

Returns true if the number is zero. Read more

fn dist(self, other: Self) -> Self[src]

Returns the distance from self to other. Read more

fn mean(self, other: Self) -> Self[src]

Returns the mean of self and other. Read more

fn recip(self) -> Self[src]

Returns the reciprocal. Read more

fn mul_add(self, mul: Self, add: Self) -> Self[src]

Multiply and add. Returns self × mul + add. Read more

fn mul_acc(&mut self, a: Self, b: Self)[src]

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

fn div_euclid(self, rhs: Self) -> Self[src]

Euclidean division by an integer. Read more

fn rem_euclid(self, rhs: Self) -> Self[src]

Remainder for Euclidean division. Read more

fn div_euclid_int(self, rhs: Self::Bits) -> Self[src]

Euclidean division by an integer. Read more

fn rem_euclid_int(self, rhs: Self::Bits) -> Self[src]

Remainder for Euclidean division by an integer. Read more

fn checked_neg(self) -> Option<Self>[src]

Checked negation. Returns the negated value, or None on overflow. Read more

fn checked_add(self, rhs: Self) -> Option<Self>[src]

Checked addition. Returns the sum, or None on overflow. Read more

fn checked_sub(self, rhs: Self) -> Option<Self>[src]

Checked subtraction. Returns the difference, or None on overflow. Read more

fn checked_mul(self, rhs: Self) -> Option<Self>[src]

Checked multiplication. Returns the product, or None on overflow. Read more

fn checked_div(self, rhs: Self) -> Option<Self>[src]

Checked division. Returns the quotient, or None if the divisor is zero or on overflow. Read more

fn checked_rem(self, rhs: Self) -> Option<Self>[src]

Checked remainder. Returns the remainder, or None if the divisor is zero. Read more

fn checked_recip(self) -> Option<Self>[src]

Checked reciprocal. Returns the reciprocal, or None if self is zero or on overflow. Read more

fn checked_mul_add(self, mul: Self, add: Self) -> Option<Self>[src]

Checked multiply and add. Returns self × mul + add, or None on overflow. Read more

fn checked_mul_acc(&mut self, a: Self, b: Self) -> Option<()>[src]

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

fn checked_div_euclid(self, rhs: Self) -> Option<Self>[src]

Checked remainder for Euclidean division. Returns the remainder, or None if the divisor is zero or the division results in overflow. Read more

fn checked_rem_euclid(self, rhs: Self) -> Option<Self>[src]

Checked remainder for Euclidean division. Returns the remainder, or None if the divisor is zero. Read more

fn checked_mul_int(self, rhs: Self::Bits) -> Option<Self>[src]

Checked multiplication by an integer. Returns the product, or None on overflow. Read more

fn checked_div_int(self, rhs: Self::Bits) -> Option<Self>[src]

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

fn checked_rem_int(self, rhs: Self::Bits) -> Option<Self>[src]

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

fn checked_div_euclid_int(self, rhs: Self::Bits) -> Option<Self>[src]

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

fn checked_rem_euclid_int(self, rhs: Self::Bits) -> Option<Self>[src]

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

fn checked_shl(self, rhs: u32) -> Option<Self>[src]

Checked shift left. Returns the shifted number, or None if rhs ≥ the number of bits. Read more

fn checked_shr(self, rhs: u32) -> Option<Self>[src]

Checked shift right. Returns the shifted number, or None if rhs ≥ the number of bits. Read more

fn checked_dist(self, other: Self) -> Option<Self>[src]

Checked distance. Returns the distance from self to other, or None on overflow. Read more

fn saturating_neg(self) -> Self[src]

Saturated negation. Returns the negated value, saturating on overflow. Read more

fn saturating_add(self, rhs: Self) -> Self[src]

Saturating addition. Returns the sum, saturating on overflow. Read more

fn saturating_sub(self, rhs: Self) -> Self[src]

Saturating subtraction. Returns the difference, saturating on overflow. Read more

fn saturating_mul(self, rhs: Self) -> Self[src]

Saturating multiplication. Returns the product, saturating on overflow. Read more

fn saturating_div(self, rhs: Self) -> Self[src]

Saturating division. Returns the quotient, saturating on overflow. Read more

fn saturating_recip(self) -> Self[src]

Saturating reciprocal. Read more

fn saturating_mul_add(self, mul: Self, add: Self) -> Self[src]

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

fn saturating_mul_acc(&mut self, a: Self, b: Self)[src]

Saturating multiply and add. Adds (a × b) to self, saturating on overflow. Read more

fn saturating_div_euclid(self, rhs: Self) -> Self[src]

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

fn saturating_mul_int(self, rhs: Self::Bits) -> Self[src]

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

fn saturating_div_euclid_int(self, rhs: Self::Bits) -> Self[src]

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

fn saturating_rem_euclid_int(self, rhs: Self::Bits) -> Self[src]

Saturating remainder for Euclidean division by an integer. Returns the remainder, saturating on overflow. Read more

fn saturating_dist(self, other: Self) -> Self[src]

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

fn wrapping_neg(self) -> Self[src]

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

fn wrapping_add(self, rhs: Self) -> Self[src]

Wrapping addition. Returns the sum, wrapping on overflow. Read more

fn wrapping_sub(self, rhs: Self) -> Self[src]

Wrapping subtraction. Returns the difference, wrapping on overflow. Read more

fn wrapping_mul(self, rhs: Self) -> Self[src]

Wrapping multiplication. Returns the product, wrapping on overflow. Read more

fn wrapping_div(self, rhs: Self) -> Self[src]

Wrapping division. Returns the quotient, wrapping on overflow. Read more

fn wrapping_recip(self) -> Self[src]

Wrapping reciprocal. Read more

fn wrapping_mul_add(self, mul: Self, add: Self) -> Self[src]

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

fn wrapping_mul_acc(&mut self, a: Self, b: Self)[src]

Wrapping multiply and accumulate. Adds (a × b) to self, wrapping on overflow. Read more

fn wrapping_div_euclid(self, rhs: Self) -> Self[src]

Wrapping Euclidean division. Returns the quotient, wrapping on overflow. Read more

fn wrapping_mul_int(self, rhs: Self::Bits) -> Self[src]

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

fn wrapping_div_int(self, rhs: Self::Bits) -> Self[src]

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

fn wrapping_div_euclid_int(self, rhs: Self::Bits) -> Self[src]

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

fn wrapping_rem_euclid_int(self, rhs: Self::Bits) -> Self[src]

Wrapping remainder for Euclidean division by an integer. Returns the remainder, wrapping on overflow. Read more

fn wrapping_shl(self, rhs: u32) -> Self[src]

Wrapping shift left. Wraps rhs if rhs ≥ the number of bits, then shifts and returns the number. Read more

fn wrapping_shr(self, rhs: u32) -> Self[src]

Wrapping shift right. Wraps rhs if rhs ≥ the number of bits, then shifts and returns the number. Read more

fn wrapping_dist(self, other: Self) -> Self[src]

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

fn unwrapped_neg(self) -> Self[src]

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

fn unwrapped_add(self, rhs: Self) -> Self[src]

Unwrapped addition. Returns the sum, panicking on overflow. Read more

fn unwrapped_sub(self, rhs: Self) -> Self[src]

Unwrapped subtraction. Returns the difference, panicking on overflow. Read more

fn unwrapped_mul(self, rhs: Self) -> Self[src]

Unwrapped multiplication. Returns the product, panicking on overflow. Read more

fn unwrapped_div(self, rhs: Self) -> Self[src]

Unwrapped division. Returns the quotient, panicking on overflow. Read more

fn unwrapped_rem(self, rhs: Self) -> Self[src]

Unwrapped remainder. Returns the quotient, panicking if the divisor is zero. Read more

fn unwrapped_recip(self) -> Self[src]

Unwrapped reciprocal. Returns reciprocal, panicking on overflow. Read more

fn unwrapped_mul_add(self, mul: Self, add: Self) -> Self[src]

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

fn unwrapped_mul_acc(&mut self, a: Self, b: Self)[src]

Unwrapped multiply and accumulate. Adds (a × b) to self, panicking on overflow. Read more

fn unwrapped_div_euclid(self, rhs: Self) -> Self[src]

Unwrapped Euclidean division. Returns the quotient, panicking on overflow. Read more

fn unwrapped_rem_euclid(self, rhs: Self) -> Self[src]

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

fn unwrapped_mul_int(self, rhs: Self::Bits) -> Self[src]

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

fn unwrapped_div_int(self, rhs: Self::Bits) -> Self[src]

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

fn unwrapped_rem_int(self, rhs: Self::Bits) -> Self[src]

Unwrapped remainder for division by an integer. Returns the remainder, panicking if the divisor is zero. Read more

fn unwrapped_div_euclid_int(self, rhs: Self::Bits) -> Self[src]

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

fn unwrapped_rem_euclid_int(self, rhs: Self::Bits) -> Self[src]

Unwrapped remainder for Euclidean division by an integer. Returns the remainder, panicking on overflow. Read more

fn unwrapped_shl(self, rhs: u32) -> Self[src]

Unwrapped shift left. Panics if rhs ≥ the number of bits. Read more

fn unwrapped_shr(self, rhs: u32) -> Self[src]

Unwrapped shift right. Panics if rhs ≥ the number of bits. Read more

fn unwrapped_dist(self, other: Self) -> Self[src]

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

fn overflowing_neg(self) -> (Self, bool)[src]

Overflowing negation. Read more

fn overflowing_add(self, rhs: Self) -> (Self, bool)[src]

Overflowing addition. Read more

fn overflowing_sub(self, rhs: Self) -> (Self, bool)[src]

Overflowing subtraction. Read more

fn overflowing_mul(self, rhs: Self) -> (Self, bool)[src]

Overflowing multiplication. Read more

fn overflowing_div(self, rhs: Self) -> (Self, bool)[src]

Overflowing division. Read more

fn overflowing_recip(self) -> (Self, bool)[src]

Overflowing reciprocal. Read more

fn overflowing_mul_add(self, mul: Self, add: Self) -> (Self, bool)[src]

Overflowing multiply and add. Read more

fn overflowing_mul_acc(&mut self, a: Self, b: Self) -> bool[src]

Overflowing multiply and accumulate. Adds (a × b) to self, wrapping and returning true if overflow occurs. Read more

fn overflowing_div_euclid(self, rhs: Self) -> (Self, bool)[src]

Overflowing Euclidean division. Read more

fn overflowing_mul_int(self, rhs: Self::Bits) -> (Self, bool)[src]

Overflowing multiplication by an integer. Read more

fn overflowing_div_int(self, rhs: Self::Bits) -> (Self, bool)[src]

Overflowing division by an integer. Read more

fn overflowing_div_euclid_int(self, rhs: Self::Bits) -> (Self, bool)[src]

Overflowing Euclidean division by an integer. Read more

fn overflowing_rem_euclid_int(self, rhs: Self::Bits) -> (Self, bool)[src]

Overflowing remainder for Euclidean division by an integer. Read more

fn overflowing_shl(self, rhs: u32) -> (Self, bool)[src]

Overflowing shift left. Read more

fn overflowing_shr(self, rhs: u32) -> (Self, bool)[src]

Overflowing shift right. Read more

fn overflowing_dist(self, other: Self) -> (Self, bool)[src]

Overflowing distance. Read more

fn get_signed(&self) -> Option<&Self::Signed>[src]

Returns a reference to self as FixedSigned if the type is signed, or None if it is unsigned. Read more

fn get_unsigned(&self) -> Option<&Self::Unsigned>[src]

Returns a reference to self as FixedUnsigned if the type is unsigned, or None if it is signed. Read more

fn get_signed_mut(&mut self) -> Option<&mut Self::Signed>[src]

Returns a mutable reference to self as FixedSigned if the type is signed, or None if it is unsigned. Read more

fn get_unsigned_mut(&mut self) -> Option<&mut Self::Unsigned>[src]

Returns a mutable reference to self as FixedUnsigned if the type is unsigned, or None if it is signed. Read more

impl<Frac: LeEqU64> FixedUnsigned for FixedU64<Frac>[src]

fn significant_bits(self) -> u32[src]

Returns the number of bits required to represent the value. Read more

fn is_power_of_two(self) -> bool[src]

Returns true if the fixed-point number is 2k for some integer k. Read more

fn highest_one(self) -> Self[src]

Returns the highest one in the binary representation, or zero if self is zero. Read more

fn next_power_of_two(self) -> Self[src]

Returns the smallest power of two that is ≥ self. Read more

fn checked_next_power_of_two(self) -> Option<Self>[src]

Returns the smallest power of two that is ≥ self, or None if the next power of two is too large to represent. Read more

fn wrapping_next_power_of_two(self) -> Self[src]

Returns the smallest power of two that is ≥ self, wrapping to 0 if the next power of two is too large to represent. Read more

fn unwrapped_next_power_of_two(self) -> Self[src]

Returns the smallest power of two that is ≥ self, panicking if the next power of two is too large to represent. Read more

impl<Frac: LeEqU64> FloatConst for FixedU64<Frac>[src]

fn E() -> Self[src]

Return Euler’s number.

fn FRAC_1_PI() -> Self[src]

Return 1.0 / π.

fn FRAC_1_SQRT_2() -> Self[src]

Return 1.0 / sqrt(2.0).

fn FRAC_2_PI() -> Self[src]

Return 2.0 / π.

fn FRAC_2_SQRT_PI() -> Self[src]

Return 2.0 / sqrt(π).

fn FRAC_PI_2() -> Self[src]

Return π / 2.0.

fn FRAC_PI_3() -> Self[src]

Return π / 3.0.

fn FRAC_PI_4() -> Self[src]

Return π / 4.0.

fn FRAC_PI_6() -> Self[src]

Return π / 6.0.

fn FRAC_PI_8() -> Self[src]

Return π / 8.0.

fn LN_10() -> Self[src]

Return ln(10.0).

fn LN_2() -> Self[src]

Return ln(2.0).

fn LOG10_E() -> Self[src]

Return log10(e).

fn LOG2_E() -> Self[src]

Return log2(e).

fn PI() -> Self[src]

Return Archimedes’ constant π.

fn SQRT_2() -> Self[src]

Return sqrt(2.0).

fn TAU() -> Self[src]

Return the full circle constant τ.

fn LOG10_2() -> Self[src]

Return log10(2.0).

fn LOG2_10() -> Self[src]

Return log2(10.0).

impl<FracSrc: LeEqU16, FracDst: LeEqU64> From<FixedU16<FracSrc>> for FixedU64<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>,
    U16: Sub<FracSrc>,
    U64: Sub<FracDst>,
    Diff<U16, FracSrc>: IsLessOrEqual<Diff<U64, FracDst>, Output = True>, 
[src]

fn from(src: FixedU16<FracSrc>) -> Self[src]

Converts a fixed-pint number.

This conversion never fails (infallible) and does not lose any precision (lossless).

impl<FracSrc: LeEqU32, FracDst: LeEqU64> From<FixedU32<FracSrc>> for FixedU64<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>,
    U32: Sub<FracSrc>,
    U64: Sub<FracDst>,
    Diff<U32, FracSrc>: IsLessOrEqual<Diff<U64, FracDst>, Output = True>, 
[src]

fn from(src: FixedU32<FracSrc>) -> Self[src]

Converts a fixed-pint number.

This conversion never fails (infallible) and does not lose any precision (lossless).

impl<Frac: LeEqU64> From<FixedU64<Frac>> for F128Bits[src]

fn from(src: FixedU64<Frac>) -> F128Bits[src]

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) and does not lose any precision (lossless).

impl<FracSrc: LeEqU64, FracDst: LeEqU128> From<FixedU64<FracSrc>> for FixedU128<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>,
    U64: Sub<FracSrc>,
    U128: Sub<FracDst>,
    Diff<U64, FracSrc>: IsLessOrEqual<Diff<U128, FracDst>, Output = True>, 
[src]

fn from(src: FixedU64<FracSrc>) -> Self[src]

Converts a fixed-pint number.

This conversion never fails (infallible) and does not lose any precision (lossless).

impl<FracSrc: LeEqU64, FracDst: LeEqU128> From<FixedU64<FracSrc>> for FixedI128<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>,
    U64: Sub<FracSrc>,
    U127: Sub<FracDst>,
    Diff<U64, FracSrc>: IsLessOrEqual<Diff<U127, FracDst>, Output = True>, 
[src]

fn from(src: FixedU64<FracSrc>) -> Self[src]

Converts a fixed-pint number.

This conversion never fails (infallible) and does not lose any precision (lossless).

impl<FracSrc: LeEqU8, FracDst: LeEqU64> From<FixedU8<FracSrc>> for FixedU64<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>,
    U8: Sub<FracSrc>,
    U64: Sub<FracDst>,
    Diff<U8, FracSrc>: IsLessOrEqual<Diff<U64, FracDst>, Output = True>, 
[src]

fn from(src: FixedU8<FracSrc>) -> Self[src]

Converts a fixed-pint number.

This conversion never fails (infallible) and does not lose any precision (lossless).

impl<FracDst: LeEqU64> From<bool> for FixedU64<FracDst> where
    U64: Sub<FracDst>,
    U1: IsLessOrEqual<Diff<U64, FracDst>, Output = True>, 
[src]

fn from(src: bool) -> Self[src]

Converts a bool to a fixed-point number.

This conversion never fails (infallible) and cannot lose any fractional bits (lossless).

impl<FracDst: LeEqU64> From<u16> for FixedU64<FracDst> where
    U64: Sub<FracDst>,
    U16: IsLessOrEqual<Diff<U64, FracDst>, Output = True>, 
[src]

fn from(src: u16) -> Self[src]

Converts an integer to a fixed-point number.

This conversion never fails (infallible) and cannot lose any fractional bits, so it is actually lossless.

impl<FracDst: LeEqU64> From<u32> for FixedU64<FracDst> where
    U64: Sub<FracDst>,
    U32: IsLessOrEqual<Diff<U64, FracDst>, Output = True>, 
[src]

fn from(src: u32) -> Self[src]

Converts an integer to a fixed-point number.

This conversion never fails (infallible) and cannot lose any fractional bits, so it is actually lossless.

impl From<u64> for FixedU64<U0>[src]

fn from(src: u64) -> Self[src]

Converts an integer to a fixed-point number.

This conversion never fails (infallible) and cannot lose any fractional bits (lossless).

impl<FracDst: LeEqU64> From<u8> for FixedU64<FracDst> where
    U64: Sub<FracDst>,
    U8: IsLessOrEqual<Diff<U64, FracDst>, Output = True>, 
[src]

fn from(src: u8) -> Self[src]

Converts an integer to a fixed-point number.

This conversion never fails (infallible) and cannot lose any fractional bits, so it is actually lossless.

impl<Frac: LeEqU64> FromFixed for FixedU64<Frac>[src]

fn from_fixed<F: Fixed>(src: F) -> Self[src]

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.

fn checked_from_fixed<F: Fixed>(src: F) -> Option<Self>[src]

Converts a fixed-point number if it fits, otherwise returns None.

Any extra fractional bits are discarded, which rounds towards −∞.

fn saturating_from_fixed<F: Fixed>(src: F) -> Self[src]

Converts a fixed-point number, saturating if it does not fit.

Any extra fractional bits are discarded, which rounds towards −∞.

fn wrapping_from_fixed<F: Fixed>(src: F) -> Self[src]

Converts a fixed-point number, wrapping if it does not fit.

Any extra fractional bits are discarded, which rounds towards −∞.

fn overflowing_from_fixed<F: Fixed>(src: F) -> (Self, bool)[src]

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 −∞.

fn unwrapped_from_fixed<F: Fixed>(src: F) -> Self[src]

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.

impl<Frac: LeEqU64> FromPrimitive for FixedU64<Frac>[src]

fn from_i64(n: i64) -> Option<Self>[src]

Converts an i64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_u64(n: u64) -> Option<Self>[src]

Converts an u64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_isize(n: isize) -> Option<Self>[src]

Converts an isize to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_i8(n: i8) -> Option<Self>[src]

Converts an i8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_i16(n: i16) -> Option<Self>[src]

Converts an i16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_i32(n: i32) -> Option<Self>[src]

Converts an i32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_i128(n: i128) -> Option<Self>[src]

Converts an i128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_usize(n: usize) -> Option<Self>[src]

Converts a usize to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_u8(n: u8) -> Option<Self>[src]

Converts an u8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_u16(n: u16) -> Option<Self>[src]

Converts an u16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_u32(n: u32) -> Option<Self>[src]

Converts an u32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_u128(n: u128) -> Option<Self>[src]

Converts an u128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_f32(n: f32) -> Option<Self>[src]

Converts a f32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_f64(n: f64) -> Option<Self>[src]

Converts a f64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

impl<Frac: LeEqU64> FromStr for FixedU64<Frac>[src]

fn from_str(s: &str) -> Result<Self, Self::Err>[src]

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.

impl<Frac> Hash for FixedU64<Frac>[src]

fn hash<H: Hasher>(&self, state: &mut H)[src]

Feeds this value into the given Hasher. Read more

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given Hasher. Read more

impl<Frac: LeEqU64> Inv for FixedU64<Frac>[src]

type Output = Self

The result after applying the operator.

fn inv(self) -> Self::Output[src]

Returns the multiplicative inverse of self. Read more

impl<FracSrc: LeEqU128, FracDst: LeEqU64> LosslessTryFrom<FixedI128<FracSrc>> for FixedU64<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>, 
[src]

fn lossless_try_from(src: FixedI128<FracSrc>) -> Option<Self>[src]

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

impl<FracSrc: LeEqU16, FracDst: LeEqU64> LosslessTryFrom<FixedI16<FracSrc>> for FixedU64<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>, 
[src]

fn lossless_try_from(src: FixedI16<FracSrc>) -> Option<Self>[src]

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

impl<FracSrc: LeEqU32, FracDst: LeEqU64> LosslessTryFrom<FixedI32<FracSrc>> for FixedU64<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>, 
[src]

fn lossless_try_from(src: FixedI32<FracSrc>) -> Option<Self>[src]

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

impl<FracSrc: LeEqU64, FracDst: LeEqU64> LosslessTryFrom<FixedI64<FracSrc>> for FixedU64<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>, 
[src]

fn lossless_try_from(src: FixedI64<FracSrc>) -> Option<Self>[src]

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

impl<FracSrc: LeEqU8, FracDst: LeEqU64> LosslessTryFrom<FixedI8<FracSrc>> for FixedU64<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>, 
[src]

fn lossless_try_from(src: FixedI8<FracSrc>) -> Option<Self>[src]

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

impl<FracSrc: LeEqU128, FracDst: LeEqU64> LosslessTryFrom<FixedU128<FracSrc>> for FixedU64<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>, 
[src]

fn lossless_try_from(src: FixedU128<FracSrc>) -> Option<Self>[src]

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

impl<FracSrc: LeEqU16, FracDst: LeEqU64> LosslessTryFrom<FixedU16<FracSrc>> for FixedU64<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>, 
[src]

fn lossless_try_from(src: FixedU16<FracSrc>) -> Option<Self>[src]

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

impl<FracSrc: LeEqU32, FracDst: LeEqU64> LosslessTryFrom<FixedU32<FracSrc>> for FixedU64<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>, 
[src]

fn lossless_try_from(src: FixedU32<FracSrc>) -> Option<Self>[src]

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

impl<Frac: LeEqU64> LosslessTryFrom<FixedU64<Frac>> for F128Bits[src]

fn lossless_try_from(src: FixedU64<Frac>) -> Option<F128Bits>[src]

Converts a fixed-point number to a floating-point number.

This conversion actually never fails (infallible) but does not lose any precision (lossless).

impl<FracSrc: LeEqU64, FracDst: LeEqU8> LosslessTryFrom<FixedU64<FracSrc>> for FixedI8<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>, 
[src]

fn lossless_try_from(src: FixedU64<FracSrc>) -> Option<Self>[src]

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

impl<FracSrc: LeEqU64, FracDst: LeEqU16> LosslessTryFrom<FixedU64<FracSrc>> for FixedI16<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>, 
[src]

fn lossless_try_from(src: FixedU64<FracSrc>) -> Option<Self>[src]

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

impl<FracSrc: LeEqU64, FracDst: LeEqU32> LosslessTryFrom<FixedU64<FracSrc>> for FixedI32<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>, 
[src]

fn lossless_try_from(src: FixedU64<FracSrc>) -> Option<Self>[src]

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

impl<FracSrc: LeEqU64, FracDst: LeEqU64> LosslessTryFrom<FixedU64<FracSrc>> for FixedI64<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>, 
[src]

fn lossless_try_from(src: FixedU64<FracSrc>) -> Option<Self>[src]

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

impl<FracSrc: LeEqU64, FracDst: LeEqU128> LosslessTryFrom<FixedU64<FracSrc>> for FixedI128<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>, 
[src]

fn lossless_try_from(src: FixedU64<FracSrc>) -> Option<Self>[src]

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

impl<FracSrc: LeEqU64, FracDst: LeEqU8> LosslessTryFrom<FixedU64<FracSrc>> for FixedU8<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>, 
[src]

fn lossless_try_from(src: FixedU64<FracSrc>) -> Option<Self>[src]

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

impl<FracSrc: LeEqU64, FracDst: LeEqU16> LosslessTryFrom<FixedU64<FracSrc>> for FixedU16<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>, 
[src]

fn lossless_try_from(src: FixedU64<FracSrc>) -> Option<Self>[src]

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

impl<FracSrc: LeEqU64, FracDst: LeEqU32> LosslessTryFrom<FixedU64<FracSrc>> for FixedU32<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>, 
[src]

fn lossless_try_from(src: FixedU64<FracSrc>) -> Option<Self>[src]

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

impl<FracSrc: LeEqU64, FracDst: LeEqU64> LosslessTryFrom<FixedU64<FracSrc>> for FixedU64<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>, 
[src]

fn lossless_try_from(src: FixedU64<FracSrc>) -> Option<Self>[src]

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

impl<FracSrc: LeEqU64, FracDst: LeEqU128> LosslessTryFrom<FixedU64<FracSrc>> for FixedU128<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>, 
[src]

fn lossless_try_from(src: FixedU64<FracSrc>) -> Option<Self>[src]

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

impl LosslessTryFrom<FixedU64<UTerm>> for i8[src]

fn lossless_try_from(src: FixedU64<U0>) -> Option<Self>[src]

Converts a fixed-point number to an integer.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl LosslessTryFrom<FixedU64<UTerm>> for i16[src]

fn lossless_try_from(src: FixedU64<U0>) -> Option<Self>[src]

Converts a fixed-point number to an integer.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl LosslessTryFrom<FixedU64<UTerm>> for u128[src]

fn lossless_try_from(src: FixedU64<U0>) -> Option<Self>[src]

Converts a fixed-point number to an integer.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl LosslessTryFrom<FixedU64<UTerm>> for usize[src]

fn lossless_try_from(src: FixedU64<U0>) -> Option<Self>[src]

Converts a fixed-point number to an integer.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl LosslessTryFrom<FixedU64<UTerm>> for i32[src]

fn lossless_try_from(src: FixedU64<U0>) -> Option<Self>[src]

Converts a fixed-point number to an integer.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl LosslessTryFrom<FixedU64<UTerm>> for i64[src]

fn lossless_try_from(src: FixedU64<U0>) -> Option<Self>[src]

Converts a fixed-point number to an integer.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl LosslessTryFrom<FixedU64<UTerm>> for i128[src]

fn lossless_try_from(src: FixedU64<U0>) -> Option<Self>[src]

Converts a fixed-point number to an integer.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl LosslessTryFrom<FixedU64<UTerm>> for isize[src]

fn lossless_try_from(src: FixedU64<U0>) -> Option<Self>[src]

Converts a fixed-point number to an integer.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl LosslessTryFrom<FixedU64<UTerm>> for u8[src]

fn lossless_try_from(src: FixedU64<U0>) -> Option<Self>[src]

Converts a fixed-point number to an integer.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl LosslessTryFrom<FixedU64<UTerm>> for u16[src]

fn lossless_try_from(src: FixedU64<U0>) -> Option<Self>[src]

Converts a fixed-point number to an integer.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl LosslessTryFrom<FixedU64<UTerm>> for u32[src]

fn lossless_try_from(src: FixedU64<U0>) -> Option<Self>[src]

Converts a fixed-point number to an integer.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl LosslessTryFrom<FixedU64<UTerm>> for u64[src]

fn lossless_try_from(src: FixedU64<U0>) -> Option<Self>[src]

Converts a fixed-point number to an integer.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl<FracSrc: LeEqU8, FracDst: LeEqU64> LosslessTryFrom<FixedU8<FracSrc>> for FixedU64<FracDst> where
    FracSrc: IsLessOrEqual<FracDst, Output = True>, 
[src]

fn lossless_try_from(src: FixedU8<FracSrc>) -> Option<Self>[src]

Converts a fixed-pint number.

This conversion may fail (fallible) but does not lose precision (lossless).

impl<Frac: LeEqU64> LosslessTryFrom<bool> for FixedU64<Frac>[src]

fn lossless_try_from(src: bool) -> Option<Self>[src]

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl<Frac: LeEqU64> LosslessTryFrom<i128> for FixedU64<Frac>[src]

fn lossless_try_from(src: i128) -> Option<Self>[src]

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl<Frac: LeEqU64> LosslessTryFrom<i16> for FixedU64<Frac>[src]

fn lossless_try_from(src: i16) -> Option<Self>[src]

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl<Frac: LeEqU64> LosslessTryFrom<i32> for FixedU64<Frac>[src]

fn lossless_try_from(src: i32) -> Option<Self>[src]

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl<Frac: LeEqU64> LosslessTryFrom<i64> for FixedU64<Frac>[src]

fn lossless_try_from(src: i64) -> Option<Self>[src]

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl<Frac: LeEqU64> LosslessTryFrom<i8> for FixedU64<Frac>[src]

fn lossless_try_from(src: i8) -> Option<Self>[src]

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl<Frac: LeEqU64> LosslessTryFrom<isize> for FixedU64<Frac>[src]

fn lossless_try_from(src: isize) -> Option<Self>[src]

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl<Frac: LeEqU64> LosslessTryFrom<u128> for FixedU64<Frac>[src]

fn lossless_try_from(src: u128) -> Option<Self>[src]

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl<Frac: LeEqU64> LosslessTryFrom<u16> for FixedU64<Frac>[src]

fn lossless_try_from(src: u16) -> Option<Self>[src]

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl<Frac: LeEqU64> LosslessTryFrom<u32> for FixedU64<Frac>[src]

fn lossless_try_from(src: u32) -> Option<Self>[src]

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl<Frac: LeEqU64> LosslessTryFrom<u64> for FixedU64<Frac>[src]

fn lossless_try_from(src: u64) -> Option<Self>[src]

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl<Frac: LeEqU64> LosslessTryFrom<u8> for FixedU64<Frac>[src]

fn lossless_try_from(src: u8) -> Option<Self>[src]

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl<Frac: LeEqU64> LosslessTryFrom<usize> for FixedU64<Frac>[src]

fn lossless_try_from(src: usize) -> Option<Self>[src]

Converts an integer to a fixed-point number.

This conversion may fail (fallible) but cannot lose any fractional bits (lossless).

impl<FracSrc: LeEqU128, FracDst: LeEqU64> LossyFrom<FixedU128<FracSrc>> for FixedU64<FracDst> where
    U128: Sub<FracSrc>,
    U64: Sub<FracDst>,
    Diff<U128, FracSrc>: IsLessOrEqual<Diff<U64, FracDst>, Output = True>, 
[src]

fn lossy_from(src: FixedU128<FracSrc>) -> Self[src]

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 −∞.

impl<FracSrc: LeEqU16, FracDst: LeEqU64> LossyFrom<FixedU16<FracSrc>> for FixedU64<FracDst> where
    U16: Sub<FracSrc>,
    U64: Sub<FracDst>,
    Diff<U16, FracSrc>: IsLessOrEqual<Diff<U64, FracDst>, Output = True>, 
[src]

fn lossy_from(src: FixedU16<FracSrc>) -> Self[src]

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 −∞.

impl<FracSrc: LeEqU32, FracDst: LeEqU64> LossyFrom<FixedU32<FracSrc>> for FixedU64<FracDst> where
    U32: Sub<FracSrc>,
    U64: Sub<FracDst>,
    Diff<U32, FracSrc>: IsLessOrEqual<Diff<U64, FracDst>, Output = True>, 
[src]

fn lossy_from(src: FixedU32<FracSrc>) -> Self[src]

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 −∞.

impl<Frac: LeEqU64> LossyFrom<FixedU64<Frac>> for f16[src]

fn lossy_from(src: FixedU64<Frac>) -> f16[src]

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.

impl<Frac: LeEqU64> LossyFrom<FixedU64<Frac>> for bf16[src]

fn lossy_from(src: FixedU64<Frac>) -> bf16[src]

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.

impl<Frac: LeEqU64> LossyFrom<FixedU64<Frac>> for f32[src]

fn lossy_from(src: FixedU64<Frac>) -> f32[src]

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.

impl<Frac: LeEqU64> LossyFrom<FixedU64<Frac>> for f64[src]

fn lossy_from(src: FixedU64<Frac>) -> f64[src]

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.

impl<Frac: LeEqU64> LossyFrom<FixedU64<Frac>> for F128Bits[src]

fn lossy_from(src: FixedU64<Frac>) -> F128Bits[src]

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.

impl<FracSrc: LeEqU64, FracDst: LeEqU8> LossyFrom<FixedU64<FracSrc>> for FixedU8<FracDst> where
    U64: Sub<FracSrc>,
    U8: Sub<FracDst>,
    Diff<U64, FracSrc>: IsLessOrEqual<Diff<U8, FracDst>, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

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 −∞.

impl<FracSrc: LeEqU64, FracDst: LeEqU8> LossyFrom<FixedU64<FracSrc>> for FixedI8<FracDst> where
    U64: Sub<FracSrc>,
    U7: Sub<FracDst>,
    Diff<U64, FracSrc>: IsLessOrEqual<Diff<U7, FracDst>, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

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 −∞.

impl<FracSrc: LeEqU64> LossyFrom<FixedU64<FracSrc>> for u8 where
    U64: Sub<FracSrc>,
    Diff<U64, FracSrc>: IsLessOrEqual<U8, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

Converts a fixed-point number to an integer.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source are discarded, which rounds towards −∞.

impl<FracSrc: LeEqU64> LossyFrom<FixedU64<FracSrc>> for i8 where
    U64: Sub<FracSrc>,
    Diff<U64, FracSrc>: IsLessOrEqual<U7, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

Converts a fixed-point number to an integer.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source are discarded, which rounds towards −∞.

impl<FracSrc: LeEqU64> LossyFrom<FixedU64<FracSrc>> for u16 where
    U64: Sub<FracSrc>,
    Diff<U64, FracSrc>: IsLessOrEqual<U16, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

Converts a fixed-point number to an integer.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source are discarded, which rounds towards −∞.

impl<FracSrc: LeEqU64> LossyFrom<FixedU64<FracSrc>> for i16 where
    U64: Sub<FracSrc>,
    Diff<U64, FracSrc>: IsLessOrEqual<U15, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

Converts a fixed-point number to an integer.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source are discarded, which rounds towards −∞.

impl<FracSrc: LeEqU64> LossyFrom<FixedU64<FracSrc>> for u32 where
    U64: Sub<FracSrc>,
    Diff<U64, FracSrc>: IsLessOrEqual<U32, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

Converts a fixed-point number to an integer.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source are discarded, which rounds towards −∞.

impl<FracSrc: LeEqU64> LossyFrom<FixedU64<FracSrc>> for i32 where
    U64: Sub<FracSrc>,
    Diff<U64, FracSrc>: IsLessOrEqual<U31, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

Converts a fixed-point number to an integer.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source are discarded, which rounds towards −∞.

impl<FracSrc: LeEqU64> LossyFrom<FixedU64<FracSrc>> for u64 where
    U64: Sub<FracSrc>,
    Diff<U64, FracSrc>: IsLessOrEqual<U64, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

Converts a fixed-point number to an integer.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source are discarded, which rounds towards −∞.

impl<FracSrc: LeEqU64> LossyFrom<FixedU64<FracSrc>> for i64 where
    U64: Sub<FracSrc>,
    Diff<U64, FracSrc>: IsLessOrEqual<U63, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

Converts a fixed-point number to an integer.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source are discarded, which rounds towards −∞.

impl<FracSrc: LeEqU64> LossyFrom<FixedU64<FracSrc>> for u128 where
    U64: Sub<FracSrc>,
    Diff<U64, FracSrc>: IsLessOrEqual<U128, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

Converts a fixed-point number to an integer.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source are discarded, which rounds towards −∞.

impl<FracSrc: LeEqU64> LossyFrom<FixedU64<FracSrc>> for i128 where
    U64: Sub<FracSrc>,
    Diff<U64, FracSrc>: IsLessOrEqual<U127, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

Converts a fixed-point number to an integer.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source are discarded, which rounds towards −∞.

impl<FracSrc: LeEqU64, FracDst: LeEqU16> LossyFrom<FixedU64<FracSrc>> for FixedU16<FracDst> where
    U64: Sub<FracSrc>,
    U16: Sub<FracDst>,
    Diff<U64, FracSrc>: IsLessOrEqual<Diff<U16, FracDst>, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

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 −∞.

impl<FracSrc: LeEqU64> LossyFrom<FixedU64<FracSrc>> for usize where
    U64: Sub<FracSrc>,
    Diff<U64, FracSrc>: IsLessOrEqual<U16, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

Converts a fixed-point number to an integer.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source are discarded, which rounds towards −∞.

impl<FracSrc: LeEqU64> LossyFrom<FixedU64<FracSrc>> for isize where
    U64: Sub<FracSrc>,
    Diff<U64, FracSrc>: IsLessOrEqual<U15, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

Converts a fixed-point number to an integer.

This conversion never fails (infallible) but may lose precision (lossy). Any fractional bits in the source are discarded, which rounds towards −∞.

impl<FracSrc: LeEqU64, FracDst: LeEqU16> LossyFrom<FixedU64<FracSrc>> for FixedI16<FracDst> where
    U64: Sub<FracSrc>,
    U15: Sub<FracDst>,
    Diff<U64, FracSrc>: IsLessOrEqual<Diff<U15, FracDst>, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

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 −∞.

impl<FracSrc: LeEqU64, FracDst: LeEqU32> LossyFrom<FixedU64<FracSrc>> for FixedU32<FracDst> where
    U64: Sub<FracSrc>,
    U32: Sub<FracDst>,
    Diff<U64, FracSrc>: IsLessOrEqual<Diff<U32, FracDst>, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

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 −∞.

impl<FracSrc: LeEqU64, FracDst: LeEqU32> LossyFrom<FixedU64<FracSrc>> for FixedI32<FracDst> where
    U64: Sub<FracSrc>,
    U31: Sub<FracDst>,
    Diff<U64, FracSrc>: IsLessOrEqual<Diff<U31, FracDst>, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

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 −∞.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> LossyFrom<FixedU64<FracSrc>> for FixedU64<FracDst> where
    U64: Sub<FracSrc>,
    U64: Sub<FracDst>,
    Diff<U64, FracSrc>: IsLessOrEqual<Diff<U64, FracDst>, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

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 −∞.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> LossyFrom<FixedU64<FracSrc>> for FixedI64<FracDst> where
    U64: Sub<FracSrc>,
    U63: Sub<FracDst>,
    Diff<U64, FracSrc>: IsLessOrEqual<Diff<U63, FracDst>, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

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 −∞.

impl<FracSrc: LeEqU64, FracDst: LeEqU128> LossyFrom<FixedU64<FracSrc>> for FixedU128<FracDst> where
    U64: Sub<FracSrc>,
    U128: Sub<FracDst>,
    Diff<U64, FracSrc>: IsLessOrEqual<Diff<U128, FracDst>, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

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 −∞.

impl<FracSrc: LeEqU64, FracDst: LeEqU128> LossyFrom<FixedU64<FracSrc>> for FixedI128<FracDst> where
    U64: Sub<FracSrc>,
    U127: Sub<FracDst>,
    Diff<U64, FracSrc>: IsLessOrEqual<Diff<U127, FracDst>, Output = True>, 
[src]

fn lossy_from(src: FixedU64<FracSrc>) -> Self[src]

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 −∞.

impl<FracSrc: LeEqU8, FracDst: LeEqU64> LossyFrom<FixedU8<FracSrc>> for FixedU64<FracDst> where
    U8: Sub<FracSrc>,
    U64: Sub<FracDst>,
    Diff<U8, FracSrc>: IsLessOrEqual<Diff<U64, FracDst>, Output = True>, 
[src]

fn lossy_from(src: FixedU8<FracSrc>) -> Self[src]

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 −∞.

impl<FracDst: LeEqU64> LossyFrom<bool> for FixedU64<FracDst> where
    U64: Sub<FracDst>,
    U1: IsLessOrEqual<Diff<U64, FracDst>, Output = True>, 
[src]

fn lossy_from(src: bool) -> Self[src]

Converts a bool to a fixed-point number.

This conversion never fails (infallible) and cannot lose any fractional bits, so it is actually lossless.

impl<FracDst: LeEqU64> LossyFrom<u16> for FixedU64<FracDst> where
    U64: Sub<FracDst>,
    U16: IsLessOrEqual<Diff<U64, FracDst>, Output = True>, 
[src]

fn lossy_from(src: u16) -> Self[src]

Converts an integer to a fixed-point number.

This conversion never fails (infallible) and cannot lose any fractional bits, so it is actually lossless.

impl<FracDst: LeEqU64> LossyFrom<u32> for FixedU64<FracDst> where
    U64: Sub<FracDst>,
    U32: IsLessOrEqual<Diff<U64, FracDst>, Output = True>, 
[src]

fn lossy_from(src: u32) -> Self[src]

Converts an integer to a fixed-point number.

This conversion never fails (infallible) and cannot lose any fractional bits, so it is actually lossless.

impl LossyFrom<u64> for FixedU64<U0>[src]

fn lossy_from(src: u64) -> Self[src]

Converts an integer to a fixed-point number.

This conversion never fails (infallible) and actually does not lose any precision (lossless).

impl<FracDst: LeEqU64> LossyFrom<u8> for FixedU64<FracDst> where
    U64: Sub<FracDst>,
    U8: IsLessOrEqual<Diff<U64, FracDst>, Output = True>, 
[src]

fn lossy_from(src: u8) -> Self[src]

Converts an integer to a fixed-point number.

This conversion never fails (infallible) and cannot lose any fractional bits, so it is actually lossless.

impl<Frac: LeEqU64> LowerHex for FixedU64<Frac>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult[src]

Formats the value using the given formatter.

impl<Frac: LeEqU64> Mul<&'_ FixedU64<Frac>> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the * operator.

fn mul(self, rhs: &FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the * operation. Read more

impl<Frac: LeEqU64> Mul<&'_ FixedU64<Frac>> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the * operator.

fn mul(self, rhs: &FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the * operation. Read more

impl<Frac: LeEqU64> Mul<&'_ u64> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the * operator.

fn mul(self, rhs: &u64) -> FixedU64<Frac>[src]

Performs the * operation. Read more

impl<Frac: LeEqU64> Mul<&'_ u64> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the * operator.

fn mul(self, rhs: &u64) -> FixedU64<Frac>[src]

Performs the * operation. Read more

impl<Frac: LeEqU64> Mul<FixedU64<Frac>> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the * operator.

fn mul(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the * operation. Read more

impl<Frac: LeEqU64> Mul<FixedU64<Frac>> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the * operator.

fn mul(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the * operation. Read more

impl<Frac: LeEqU64> Mul<u64> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the * operator.

fn mul(self, rhs: u64) -> FixedU64<Frac>[src]

Performs the * operation. Read more

impl<Frac: LeEqU64> Mul<u64> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the * operator.

fn mul(self, rhs: u64) -> FixedU64<Frac>[src]

Performs the * operation. Read more

impl<Frac, MulFrac: LeEqU64> MulAdd<FixedU64<MulFrac>, FixedU64<Frac>> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the fused multiply-add.

fn mul_add(self, a: FixedU64<MulFrac>, b: FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the fused multiply-add operation.

impl<Frac, MulFrac: LeEqU64> MulAddAssign<FixedU64<MulFrac>, FixedU64<Frac>> for FixedU64<Frac>[src]

fn mul_add_assign(&mut self, a: FixedU64<MulFrac>, b: FixedU64<Frac>)[src]

Performs the fused multiply-add operation.

impl<Frac, RhsFrac: LeEqU64> MulAssign<&'_ FixedU64<RhsFrac>> for FixedU64<Frac>[src]

fn mul_assign(&mut self, rhs: &FixedU64<RhsFrac>)[src]

Performs the *= operation. Read more

impl<Frac: LeEqU64> MulAssign<&'_ u64> for FixedU64<Frac>[src]

fn mul_assign(&mut self, rhs: &u64)[src]

Performs the *= operation. Read more

impl<Frac, RhsFrac: LeEqU64> MulAssign<FixedU64<RhsFrac>> for FixedU64<Frac>[src]

fn mul_assign(&mut self, rhs: FixedU64<RhsFrac>)[src]

Performs the *= operation. Read more

impl<Frac: LeEqU64> MulAssign<u64> for FixedU64<Frac>[src]

fn mul_assign(&mut self, rhs: u64)[src]

Performs the *= operation. Read more

impl<Frac> Not for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the ! operator.

fn not(self) -> FixedU64<Frac>[src]

Performs the unary ! operation. Read more

impl<Frac> Not for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the ! operator.

fn not(self) -> FixedU64<Frac>[src]

Performs the unary ! operation. Read more

impl<Frac: LeEqU64> Num for FixedU64<Frac> where
    Frac: IsLessOrEqual<U63, Output = True>, 
[src]

type FromStrRadixErr = RadixParseFixedError

fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>[src]

Convert from a string and radix (typically 2..=36). Read more

impl<Frac: LeEqU64> Octal for FixedU64<Frac>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult[src]

Formats the value using the given formatter.

impl<Frac: LeEqU64> One for FixedU64<Frac> where
    Frac: IsLessOrEqual<U63, Output = True>, 
[src]

fn one() -> Self[src]

Returns the multiplicative identity element of Self, 1. Read more

fn set_one(&mut self)[src]

Sets self to the multiplicative identity element of Self, 1.

fn is_one(&self) -> bool where
    Self: PartialEq<Self>, 
[src]

Returns true if self is equal to the multiplicative identity. Read more

impl<Frac: LeEqU64> Ord for FixedU64<Frac>[src]

fn cmp(&self, rhs: &FixedU64<Frac>) -> Ordering[src]

This method returns an Ordering between self and other. Read more

#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]

Compares and returns the maximum of two values. Read more

#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]

Compares and returns the minimum of two values. Read more

#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]

Restrict a value to a certain interval. Read more

impl<Frac> OverflowingAdd for FixedU64<Frac>[src]

fn overflowing_add(&self, v: &Self) -> (Self, bool)[src]

Returns a tuple of the sum along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned. Read more

impl<Frac: LeEqU64> OverflowingCast<F128Bits> for FixedU64<Frac>[src]

fn overflowing_cast(self) -> (F128Bits, bool)[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU128> OverflowingCast<FixedI128<FracDst>> for FixedU64<FracSrc>[src]

fn overflowing_cast(self) -> (FixedI128<FracDst>, bool)[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU16> OverflowingCast<FixedI16<FracDst>> for FixedU64<FracSrc>[src]

fn overflowing_cast(self) -> (FixedI16<FracDst>, bool)[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU32> OverflowingCast<FixedI32<FracDst>> for FixedU64<FracSrc>[src]

fn overflowing_cast(self) -> (FixedI32<FracDst>, bool)[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> OverflowingCast<FixedI64<FracDst>> for FixedU64<FracSrc>[src]

fn overflowing_cast(self) -> (FixedI64<FracDst>, bool)[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU8> OverflowingCast<FixedI8<FracDst>> for FixedU64<FracSrc>[src]

fn overflowing_cast(self) -> (FixedI8<FracDst>, bool)[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU128> OverflowingCast<FixedU128<FracDst>> for FixedU64<FracSrc>[src]

fn overflowing_cast(self) -> (FixedU128<FracDst>, bool)[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU16> OverflowingCast<FixedU16<FracDst>> for FixedU64<FracSrc>[src]

fn overflowing_cast(self) -> (FixedU16<FracDst>, bool)[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU32> OverflowingCast<FixedU32<FracDst>> for FixedU64<FracSrc>[src]

fn overflowing_cast(self) -> (FixedU32<FracDst>, bool)[src]

Casts the value.

impl<Frac: LeEqU64> OverflowingCast<FixedU64<Frac>> for F128Bits[src]

fn overflowing_cast(self) -> (FixedU64<Frac>, bool)[src]

Casts the value.

impl<FracSrc: LeEqU8, FracDst: LeEqU64> OverflowingCast<FixedU64<FracDst>> for FixedI8<FracSrc>[src]

fn overflowing_cast(self) -> (FixedU64<FracDst>, bool)[src]

Casts the value.

impl<FracSrc: LeEqU16, FracDst: LeEqU64> OverflowingCast<FixedU64<FracDst>> for FixedI16<FracSrc>[src]

fn overflowing_cast(self) -> (FixedU64<FracDst>, bool)[src]

Casts the value.

impl<FracSrc: LeEqU32, FracDst: LeEqU64> OverflowingCast<FixedU64<FracDst>> for FixedI32<FracSrc>[src]

fn overflowing_cast(self) -> (FixedU64<FracDst>, bool)[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> OverflowingCast<FixedU64<FracDst>> for FixedI64<FracSrc>[src]

fn overflowing_cast(self) -> (FixedU64<FracDst>, bool)[src]

Casts the value.

impl<FracSrc: LeEqU128, FracDst: LeEqU64> OverflowingCast<FixedU64<FracDst>> for FixedI128<FracSrc>[src]

fn overflowing_cast(self) -> (FixedU64<FracDst>, bool)[src]

Casts the value.

impl<FracSrc: LeEqU8, FracDst: LeEqU64> OverflowingCast<FixedU64<FracDst>> for FixedU8<FracSrc>[src]

fn overflowing_cast(self) -> (FixedU64<FracDst>, bool)[src]

Casts the value.

impl<FracSrc: LeEqU16, FracDst: LeEqU64> OverflowingCast<FixedU64<FracDst>> for FixedU16<FracSrc>[src]

fn overflowing_cast(self) -> (FixedU64<FracDst>, bool)[src]

Casts the value.

impl<FracSrc: LeEqU32, FracDst: LeEqU64> OverflowingCast<FixedU64<FracDst>> for FixedU32<FracSrc>[src]

fn overflowing_cast(self) -> (FixedU64<FracDst>, bool)[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> OverflowingCast<FixedU64<FracDst>> for FixedU64<FracSrc>[src]

fn overflowing_cast(self) -> (FixedU64<FracDst>, bool)[src]

Casts the value.

impl<FracSrc: LeEqU128, FracDst: LeEqU64> OverflowingCast<FixedU64<FracDst>> for FixedU128<FracSrc>[src]

fn overflowing_cast(self) -> (FixedU64<FracDst>, bool)[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU8> OverflowingCast<FixedU8<FracDst>> for FixedU64<FracSrc>[src]

fn overflowing_cast(self) -> (FixedU8<FracDst>, bool)[src]

Casts the value.

impl<Frac: LeEqU64> OverflowingCast<bf16> for FixedU64<Frac>[src]

fn overflowing_cast(self) -> (bf16, bool)[src]

Casts the value.

impl<Frac: LeEqU64> OverflowingCast<f16> for FixedU64<Frac>[src]

fn overflowing_cast(self) -> (f16, bool)[src]

Casts the value.

impl<Frac: LeEqU64> OverflowingCast<f32> for FixedU64<Frac>[src]

fn overflowing_cast(self) -> (f32, bool)[src]

Casts the value.

impl<Frac: LeEqU64> OverflowingCast<f64> for FixedU64<Frac>[src]

fn overflowing_cast(self) -> (f64, bool)[src]

Casts the value.

impl<Frac: LeEqU64> OverflowingCast<i128> for FixedU64<Frac>[src]

fn overflowing_cast(self) -> (i128, bool)[src]

Casts the value.

impl<Frac: LeEqU64> OverflowingCast<i16> for FixedU64<Frac>[src]

fn overflowing_cast(self) -> (i16, bool)[src]

Casts the value.

impl<Frac: LeEqU64> OverflowingCast<i32> for FixedU64<Frac>[src]

fn overflowing_cast(self) -> (i32, bool)[src]

Casts the value.

impl<Frac: LeEqU64> OverflowingCast<i64> for FixedU64<Frac>[src]

fn overflowing_cast(self) -> (i64, bool)[src]

Casts the value.

impl<Frac: LeEqU64> OverflowingCast<i8> for FixedU64<Frac>[src]

fn overflowing_cast(self) -> (i8, bool)[src]

Casts the value.

impl<Frac: LeEqU64> OverflowingCast<isize> for FixedU64<Frac>[src]

fn overflowing_cast(self) -> (isize, bool)[src]

Casts the value.

impl<Frac: LeEqU64> OverflowingCast<u128> for FixedU64<Frac>[src]

fn overflowing_cast(self) -> (u128, bool)[src]

Casts the value.

impl<Frac: LeEqU64> OverflowingCast<u16> for FixedU64<Frac>[src]

fn overflowing_cast(self) -> (u16, bool)[src]

Casts the value.

impl<Frac: LeEqU64> OverflowingCast<u32> for FixedU64<Frac>[src]

fn overflowing_cast(self) -> (u32, bool)[src]

Casts the value.

impl<Frac: LeEqU64> OverflowingCast<u64> for FixedU64<Frac>[src]

fn overflowing_cast(self) -> (u64, bool)[src]

Casts the value.

impl<Frac: LeEqU64> OverflowingCast<u8> for FixedU64<Frac>[src]

fn overflowing_cast(self) -> (u8, bool)[src]

Casts the value.

impl<Frac: LeEqU64> OverflowingCast<usize> for FixedU64<Frac>[src]

fn overflowing_cast(self) -> (usize, bool)[src]

Casts the value.

impl<Frac: LeEqU64> OverflowingMul for FixedU64<Frac>[src]

fn overflowing_mul(&self, v: &Self) -> (Self, bool)[src]

Returns a tuple of the product along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned. Read more

impl<Frac> OverflowingSub for FixedU64<Frac>[src]

fn overflowing_sub(&self, v: &Self) -> (Self, bool)[src]

Returns a tuple of the difference along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned. Read more

impl<Frac: LeEqU64> PartialEq<F128Bits> for FixedU64<Frac>[src]

fn eq(&self, rhs: &F128Bits) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<FracLhs: LeEqU64, FracRhs: LeEqU128> PartialEq<FixedI128<FracRhs>> for FixedU64<FracLhs>[src]

fn eq(&self, rhs: &FixedI128<FracRhs>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<FracLhs: LeEqU64, FracRhs: LeEqU16> PartialEq<FixedI16<FracRhs>> for FixedU64<FracLhs>[src]

fn eq(&self, rhs: &FixedI16<FracRhs>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<FracLhs: LeEqU64, FracRhs: LeEqU32> PartialEq<FixedI32<FracRhs>> for FixedU64<FracLhs>[src]

fn eq(&self, rhs: &FixedI32<FracRhs>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<FracLhs: LeEqU64, FracRhs: LeEqU64> PartialEq<FixedI64<FracRhs>> for FixedU64<FracLhs>[src]

fn eq(&self, rhs: &FixedI64<FracRhs>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<FracLhs: LeEqU64, FracRhs: LeEqU8> PartialEq<FixedI8<FracRhs>> for FixedU64<FracLhs>[src]

fn eq(&self, rhs: &FixedI8<FracRhs>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<FracLhs: LeEqU64, FracRhs: LeEqU128> PartialEq<FixedU128<FracRhs>> for FixedU64<FracLhs>[src]

fn eq(&self, rhs: &FixedU128<FracRhs>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<FracLhs: LeEqU64, FracRhs: LeEqU16> PartialEq<FixedU16<FracRhs>> for FixedU64<FracLhs>[src]

fn eq(&self, rhs: &FixedU16<FracRhs>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<FracLhs: LeEqU64, FracRhs: LeEqU32> PartialEq<FixedU32<FracRhs>> for FixedU64<FracLhs>[src]

fn eq(&self, rhs: &FixedU32<FracRhs>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<Frac: LeEqU64> PartialEq<FixedU64<Frac>> for F128Bits[src]

fn eq(&self, rhs: &FixedU64<Frac>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<FracLhs: LeEqU8, FracRhs: LeEqU64> PartialEq<FixedU64<FracRhs>> for FixedI8<FracLhs>[src]

fn eq(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<FracLhs: LeEqU16, FracRhs: LeEqU64> PartialEq<FixedU64<FracRhs>> for FixedI16<FracLhs>[src]

fn eq(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<FracLhs: LeEqU32, FracRhs: LeEqU64> PartialEq<FixedU64<FracRhs>> for FixedI32<FracLhs>[src]

fn eq(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<FracLhs: LeEqU64, FracRhs: LeEqU64> PartialEq<FixedU64<FracRhs>> for FixedI64<FracLhs>[src]

fn eq(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<FracLhs: LeEqU128, FracRhs: LeEqU64> PartialEq<FixedU64<FracRhs>> for FixedI128<FracLhs>[src]

fn eq(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<FracLhs: LeEqU8, FracRhs: LeEqU64> PartialEq<FixedU64<FracRhs>> for FixedU8<FracLhs>[src]

fn eq(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<FracLhs: LeEqU16, FracRhs: LeEqU64> PartialEq<FixedU64<FracRhs>> for FixedU16<FracLhs>[src]

fn eq(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<FracLhs: LeEqU32, FracRhs: LeEqU64> PartialEq<FixedU64<FracRhs>> for FixedU32<FracLhs>[src]

fn eq(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<FracLhs: LeEqU64, FracRhs: LeEqU64> PartialEq<FixedU64<FracRhs>> for FixedU64<FracLhs>[src]

fn eq(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<FracLhs: LeEqU128, FracRhs: LeEqU64> PartialEq<FixedU64<FracRhs>> for FixedU128<FracLhs>[src]

fn eq(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<FracLhs: LeEqU64, FracRhs: LeEqU8> PartialEq<FixedU8<FracRhs>> for FixedU64<FracLhs>[src]

fn eq(&self, rhs: &FixedU8<FracRhs>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<Frac: LeEqU64> PartialEq<bf16> for FixedU64<Frac>[src]

fn eq(&self, rhs: &bf16) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<Frac: LeEqU64> PartialEq<f16> for FixedU64<Frac>[src]

fn eq(&self, rhs: &f16) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<Frac: LeEqU64> PartialEq<f32> for FixedU64<Frac>[src]

fn eq(&self, rhs: &f32) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<Frac: LeEqU64> PartialEq<f64> for FixedU64<Frac>[src]

fn eq(&self, rhs: &f64) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<Frac: LeEqU64> PartialEq<i128> for FixedU64<Frac>[src]

fn eq(&self, rhs: &i128) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<Frac: LeEqU64> PartialEq<i16> for FixedU64<Frac>[src]

fn eq(&self, rhs: &i16) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<Frac: LeEqU64> PartialEq<i32> for FixedU64<Frac>[src]

fn eq(&self, rhs: &i32) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<Frac: LeEqU64> PartialEq<i64> for FixedU64<Frac>[src]

fn eq(&self, rhs: &i64) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<Frac: LeEqU64> PartialEq<i8> for FixedU64<Frac>[src]

fn eq(&self, rhs: &i8) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<Frac: LeEqU64> PartialEq<isize> for FixedU64<Frac>[src]

fn eq(&self, rhs: &isize) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<Frac: LeEqU64> PartialEq<u128> for FixedU64<Frac>[src]

fn eq(&self, rhs: &u128) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<Frac: LeEqU64> PartialEq<u16> for FixedU64<Frac>[src]

fn eq(&self, rhs: &u16) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<Frac: LeEqU64> PartialEq<u32> for FixedU64<Frac>[src]

fn eq(&self, rhs: &u32) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<Frac: LeEqU64> PartialEq<u64> for FixedU64<Frac>[src]

fn eq(&self, rhs: &u64) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<Frac: LeEqU64> PartialEq<u8> for FixedU64<Frac>[src]

fn eq(&self, rhs: &u8) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<Frac: LeEqU64> PartialEq<usize> for FixedU64<Frac>[src]

fn eq(&self, rhs: &usize) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<Frac: LeEqU64> PartialOrd<F128Bits> for FixedU64<Frac>[src]

fn partial_cmp(&self, rhs: &F128Bits) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &F128Bits) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &F128Bits) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &F128Bits) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &F128Bits) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<FracLhs: LeEqU64, FracRhs: LeEqU128> PartialOrd<FixedI128<FracRhs>> for FixedU64<FracLhs>[src]

fn partial_cmp(&self, rhs: &FixedI128<FracRhs>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedI128<FracRhs>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedI128<FracRhs>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedI128<FracRhs>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedI128<FracRhs>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<FracLhs: LeEqU64, FracRhs: LeEqU16> PartialOrd<FixedI16<FracRhs>> for FixedU64<FracLhs>[src]

fn partial_cmp(&self, rhs: &FixedI16<FracRhs>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedI16<FracRhs>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedI16<FracRhs>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedI16<FracRhs>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedI16<FracRhs>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<FracLhs: LeEqU64, FracRhs: LeEqU32> PartialOrd<FixedI32<FracRhs>> for FixedU64<FracLhs>[src]

fn partial_cmp(&self, rhs: &FixedI32<FracRhs>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedI32<FracRhs>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedI32<FracRhs>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedI32<FracRhs>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedI32<FracRhs>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<FracLhs: LeEqU64, FracRhs: LeEqU64> PartialOrd<FixedI64<FracRhs>> for FixedU64<FracLhs>[src]

fn partial_cmp(&self, rhs: &FixedI64<FracRhs>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedI64<FracRhs>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedI64<FracRhs>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedI64<FracRhs>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedI64<FracRhs>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<FracLhs: LeEqU64, FracRhs: LeEqU8> PartialOrd<FixedI8<FracRhs>> for FixedU64<FracLhs>[src]

fn partial_cmp(&self, rhs: &FixedI8<FracRhs>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedI8<FracRhs>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedI8<FracRhs>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedI8<FracRhs>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedI8<FracRhs>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<FracLhs: LeEqU64, FracRhs: LeEqU128> PartialOrd<FixedU128<FracRhs>> for FixedU64<FracLhs>[src]

fn partial_cmp(&self, rhs: &FixedU128<FracRhs>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedU128<FracRhs>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedU128<FracRhs>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedU128<FracRhs>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedU128<FracRhs>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<FracLhs: LeEqU64, FracRhs: LeEqU16> PartialOrd<FixedU16<FracRhs>> for FixedU64<FracLhs>[src]

fn partial_cmp(&self, rhs: &FixedU16<FracRhs>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedU16<FracRhs>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedU16<FracRhs>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedU16<FracRhs>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedU16<FracRhs>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<FracLhs: LeEqU64, FracRhs: LeEqU32> PartialOrd<FixedU32<FracRhs>> for FixedU64<FracLhs>[src]

fn partial_cmp(&self, rhs: &FixedU32<FracRhs>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedU32<FracRhs>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedU32<FracRhs>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedU32<FracRhs>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedU32<FracRhs>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<Frac: LeEqU64> PartialOrd<FixedU64<Frac>> for F128Bits[src]

fn partial_cmp(&self, rhs: &FixedU64<Frac>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedU64<Frac>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedU64<Frac>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedU64<Frac>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedU64<Frac>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<FracLhs: LeEqU8, FracRhs: LeEqU64> PartialOrd<FixedU64<FracRhs>> for FixedI8<FracLhs>[src]

fn partial_cmp(&self, rhs: &FixedU64<FracRhs>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<FracLhs: LeEqU16, FracRhs: LeEqU64> PartialOrd<FixedU64<FracRhs>> for FixedI16<FracLhs>[src]

fn partial_cmp(&self, rhs: &FixedU64<FracRhs>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<FracLhs: LeEqU32, FracRhs: LeEqU64> PartialOrd<FixedU64<FracRhs>> for FixedI32<FracLhs>[src]

fn partial_cmp(&self, rhs: &FixedU64<FracRhs>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<FracLhs: LeEqU64, FracRhs: LeEqU64> PartialOrd<FixedU64<FracRhs>> for FixedI64<FracLhs>[src]

fn partial_cmp(&self, rhs: &FixedU64<FracRhs>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<FracLhs: LeEqU128, FracRhs: LeEqU64> PartialOrd<FixedU64<FracRhs>> for FixedI128<FracLhs>[src]

fn partial_cmp(&self, rhs: &FixedU64<FracRhs>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<FracLhs: LeEqU8, FracRhs: LeEqU64> PartialOrd<FixedU64<FracRhs>> for FixedU8<FracLhs>[src]

fn partial_cmp(&self, rhs: &FixedU64<FracRhs>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<FracLhs: LeEqU16, FracRhs: LeEqU64> PartialOrd<FixedU64<FracRhs>> for FixedU16<FracLhs>[src]

fn partial_cmp(&self, rhs: &FixedU64<FracRhs>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<FracLhs: LeEqU32, FracRhs: LeEqU64> PartialOrd<FixedU64<FracRhs>> for FixedU32<FracLhs>[src]

fn partial_cmp(&self, rhs: &FixedU64<FracRhs>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<FracLhs: LeEqU64, FracRhs: LeEqU64> PartialOrd<FixedU64<FracRhs>> for FixedU64<FracLhs>[src]

fn partial_cmp(&self, rhs: &FixedU64<FracRhs>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<FracLhs: LeEqU128, FracRhs: LeEqU64> PartialOrd<FixedU64<FracRhs>> for FixedU128<FracLhs>[src]

fn partial_cmp(&self, rhs: &FixedU64<FracRhs>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedU64<FracRhs>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<FracLhs: LeEqU64, FracRhs: LeEqU8> PartialOrd<FixedU8<FracRhs>> for FixedU64<FracLhs>[src]

fn partial_cmp(&self, rhs: &FixedU8<FracRhs>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &FixedU8<FracRhs>) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &FixedU8<FracRhs>) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &FixedU8<FracRhs>) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &FixedU8<FracRhs>) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<Frac: LeEqU64> PartialOrd<bf16> for FixedU64<Frac>[src]

fn partial_cmp(&self, rhs: &bf16) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &bf16) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &bf16) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &bf16) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &bf16) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<Frac: LeEqU64> PartialOrd<f16> for FixedU64<Frac>[src]

fn partial_cmp(&self, rhs: &f16) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &f16) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &f16) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &f16) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &f16) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<Frac: LeEqU64> PartialOrd<f32> for FixedU64<Frac>[src]

fn partial_cmp(&self, rhs: &f32) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &f32) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &f32) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &f32) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &f32) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<Frac: LeEqU64> PartialOrd<f64> for FixedU64<Frac>[src]

fn partial_cmp(&self, rhs: &f64) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &f64) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &f64) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &f64) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &f64) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<Frac: LeEqU64> PartialOrd<i128> for FixedU64<Frac>[src]

fn partial_cmp(&self, rhs: &i128) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &i128) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &i128) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &i128) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &i128) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<Frac: LeEqU64> PartialOrd<i16> for FixedU64<Frac>[src]

fn partial_cmp(&self, rhs: &i16) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &i16) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &i16) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &i16) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &i16) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<Frac: LeEqU64> PartialOrd<i32> for FixedU64<Frac>[src]

fn partial_cmp(&self, rhs: &i32) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &i32) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &i32) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &i32) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &i32) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<Frac: LeEqU64> PartialOrd<i64> for FixedU64<Frac>[src]

fn partial_cmp(&self, rhs: &i64) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &i64) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &i64) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &i64) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &i64) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<Frac: LeEqU64> PartialOrd<i8> for FixedU64<Frac>[src]

fn partial_cmp(&self, rhs: &i8) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &i8) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &i8) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &i8) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &i8) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<Frac: LeEqU64> PartialOrd<isize> for FixedU64<Frac>[src]

fn partial_cmp(&self, rhs: &isize) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &isize) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &isize) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &isize) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &isize) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<Frac: LeEqU64> PartialOrd<u128> for FixedU64<Frac>[src]

fn partial_cmp(&self, rhs: &u128) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &u128) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &u128) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &u128) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &u128) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<Frac: LeEqU64> PartialOrd<u16> for FixedU64<Frac>[src]

fn partial_cmp(&self, rhs: &u16) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &u16) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &u16) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &u16) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &u16) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<Frac: LeEqU64> PartialOrd<u32> for FixedU64<Frac>[src]

fn partial_cmp(&self, rhs: &u32) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &u32) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &u32) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &u32) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &u32) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<Frac: LeEqU64> PartialOrd<u64> for FixedU64<Frac>[src]

fn partial_cmp(&self, rhs: &u64) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &u64) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &u64) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &u64) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &u64) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<Frac: LeEqU64> PartialOrd<u8> for FixedU64<Frac>[src]

fn partial_cmp(&self, rhs: &u8) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &u8) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &u8) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &u8) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &u8) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<Frac: LeEqU64> PartialOrd<usize> for FixedU64<Frac>[src]

fn partial_cmp(&self, rhs: &usize) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, rhs: &usize) -> bool[src]

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, rhs: &usize) -> bool[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, rhs: &usize) -> bool[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, rhs: &usize) -> bool[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'a, Frac: 'a + LeEqU64> Product<&'a FixedU64<Frac>> for FixedU64<Frac>[src]

fn product<I>(iter: I) -> FixedU64<Frac> where
    I: Iterator<Item = &'a FixedU64<Frac>>, 
[src]

Method which takes an iterator and generates Self from the elements by multiplying the items. Read more

impl<Frac: LeEqU64> Product<FixedU64<Frac>> for FixedU64<Frac>[src]

fn product<I>(iter: I) -> FixedU64<Frac> where
    I: Iterator<Item = FixedU64<Frac>>, 
[src]

Method which takes an iterator and generates Self from the elements by multiplying the items. Read more

impl<Frac> Rem<&'_ FixedU64<Frac>> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the % operator.

fn rem(self, rhs: &FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the % operation. Read more

impl<Frac> Rem<&'_ FixedU64<Frac>> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the % operator.

fn rem(self, rhs: &FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the % operation. Read more

impl<Frac: LeEqU64> Rem<&'_ u64> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the % operator.

fn rem(self, rhs: &u64) -> FixedU64<Frac>[src]

Performs the % operation. Read more

impl<Frac: LeEqU64> Rem<&'_ u64> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the % operator.

fn rem(self, rhs: &u64) -> FixedU64<Frac>[src]

Performs the % operation. Read more

impl<Frac> Rem<FixedU64<Frac>> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the % operator.

fn rem(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the % operation. Read more

impl<Frac> Rem<FixedU64<Frac>> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the % operator.

fn rem(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the % operation. Read more

impl<Frac: LeEqU64> Rem<u64> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the % operator.

fn rem(self, rhs: u64) -> FixedU64<Frac>[src]

Performs the % operation. Read more

impl<Frac: LeEqU64> Rem<u64> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the % operator.

fn rem(self, rhs: u64) -> FixedU64<Frac>[src]

Performs the % operation. Read more

impl<Frac> RemAssign<&'_ FixedU64<Frac>> for FixedU64<Frac>[src]

fn rem_assign(&mut self, rhs: &FixedU64<Frac>)[src]

Performs the %= operation. Read more

impl<Frac: LeEqU64> RemAssign<&'_ u64> for FixedU64<Frac>[src]

fn rem_assign(&mut self, rhs: &u64)[src]

Performs the %= operation. Read more

impl<Frac> RemAssign<FixedU64<Frac>> for FixedU64<Frac>[src]

fn rem_assign(&mut self, rhs: FixedU64<Frac>)[src]

Performs the %= operation. Read more

impl<Frac: LeEqU64> RemAssign<u64> for FixedU64<Frac>[src]

fn rem_assign(&mut self, rhs: u64)[src]

Performs the %= operation. Read more

impl<Frac> SaturatingAdd for FixedU64<Frac>[src]

fn saturating_add(&self, v: &Self) -> Self[src]

Saturating addition. Computes self + other, saturating at the relevant high or low boundary of the type. Read more

impl<Frac: LeEqU64> SaturatingCast<F128Bits> for FixedU64<Frac>[src]

fn saturating_cast(self) -> F128Bits[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU128> SaturatingCast<FixedI128<FracDst>> for FixedU64<FracSrc>[src]

fn saturating_cast(self) -> FixedI128<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU16> SaturatingCast<FixedI16<FracDst>> for FixedU64<FracSrc>[src]

fn saturating_cast(self) -> FixedI16<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU32> SaturatingCast<FixedI32<FracDst>> for FixedU64<FracSrc>[src]

fn saturating_cast(self) -> FixedI32<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> SaturatingCast<FixedI64<FracDst>> for FixedU64<FracSrc>[src]

fn saturating_cast(self) -> FixedI64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU8> SaturatingCast<FixedI8<FracDst>> for FixedU64<FracSrc>[src]

fn saturating_cast(self) -> FixedI8<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU128> SaturatingCast<FixedU128<FracDst>> for FixedU64<FracSrc>[src]

fn saturating_cast(self) -> FixedU128<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU16> SaturatingCast<FixedU16<FracDst>> for FixedU64<FracSrc>[src]

fn saturating_cast(self) -> FixedU16<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU32> SaturatingCast<FixedU32<FracDst>> for FixedU64<FracSrc>[src]

fn saturating_cast(self) -> FixedU32<FracDst>[src]

Casts the value.

impl<Frac: LeEqU64> SaturatingCast<FixedU64<Frac>> for F128Bits[src]

fn saturating_cast(self) -> FixedU64<Frac>[src]

Casts the value.

impl<FracSrc: LeEqU8, FracDst: LeEqU64> SaturatingCast<FixedU64<FracDst>> for FixedI8<FracSrc>[src]

fn saturating_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU16, FracDst: LeEqU64> SaturatingCast<FixedU64<FracDst>> for FixedI16<FracSrc>[src]

fn saturating_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU32, FracDst: LeEqU64> SaturatingCast<FixedU64<FracDst>> for FixedI32<FracSrc>[src]

fn saturating_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> SaturatingCast<FixedU64<FracDst>> for FixedI64<FracSrc>[src]

fn saturating_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU128, FracDst: LeEqU64> SaturatingCast<FixedU64<FracDst>> for FixedI128<FracSrc>[src]

fn saturating_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU8, FracDst: LeEqU64> SaturatingCast<FixedU64<FracDst>> for FixedU8<FracSrc>[src]

fn saturating_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU16, FracDst: LeEqU64> SaturatingCast<FixedU64<FracDst>> for FixedU16<FracSrc>[src]

fn saturating_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU32, FracDst: LeEqU64> SaturatingCast<FixedU64<FracDst>> for FixedU32<FracSrc>[src]

fn saturating_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> SaturatingCast<FixedU64<FracDst>> for FixedU64<FracSrc>[src]

fn saturating_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU128, FracDst: LeEqU64> SaturatingCast<FixedU64<FracDst>> for FixedU128<FracSrc>[src]

fn saturating_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU8> SaturatingCast<FixedU8<FracDst>> for FixedU64<FracSrc>[src]

fn saturating_cast(self) -> FixedU8<FracDst>[src]

Casts the value.

impl<Frac: LeEqU64> SaturatingCast<bf16> for FixedU64<Frac>[src]

fn saturating_cast(self) -> bf16[src]

Casts the value.

impl<Frac: LeEqU64> SaturatingCast<f16> for FixedU64<Frac>[src]

fn saturating_cast(self) -> f16[src]

Casts the value.

impl<Frac: LeEqU64> SaturatingCast<f32> for FixedU64<Frac>[src]

fn saturating_cast(self) -> f32[src]

Casts the value.

impl<Frac: LeEqU64> SaturatingCast<f64> for FixedU64<Frac>[src]

fn saturating_cast(self) -> f64[src]

Casts the value.

impl<Frac: LeEqU64> SaturatingCast<i128> for FixedU64<Frac>[src]

fn saturating_cast(self) -> i128[src]

Casts the value.

impl<Frac: LeEqU64> SaturatingCast<i16> for FixedU64<Frac>[src]

fn saturating_cast(self) -> i16[src]

Casts the value.

impl<Frac: LeEqU64> SaturatingCast<i32> for FixedU64<Frac>[src]

fn saturating_cast(self) -> i32[src]

Casts the value.

impl<Frac: LeEqU64> SaturatingCast<i64> for FixedU64<Frac>[src]

fn saturating_cast(self) -> i64[src]

Casts the value.

impl<Frac: LeEqU64> SaturatingCast<i8> for FixedU64<Frac>[src]

fn saturating_cast(self) -> i8[src]

Casts the value.

impl<Frac: LeEqU64> SaturatingCast<isize> for FixedU64<Frac>[src]

fn saturating_cast(self) -> isize[src]

Casts the value.

impl<Frac: LeEqU64> SaturatingCast<u128> for FixedU64<Frac>[src]

fn saturating_cast(self) -> u128[src]

Casts the value.

impl<Frac: LeEqU64> SaturatingCast<u16> for FixedU64<Frac>[src]

fn saturating_cast(self) -> u16[src]

Casts the value.

impl<Frac: LeEqU64> SaturatingCast<u32> for FixedU64<Frac>[src]

fn saturating_cast(self) -> u32[src]

Casts the value.

impl<Frac: LeEqU64> SaturatingCast<u64> for FixedU64<Frac>[src]

fn saturating_cast(self) -> u64[src]

Casts the value.

impl<Frac: LeEqU64> SaturatingCast<u8> for FixedU64<Frac>[src]

fn saturating_cast(self) -> u8[src]

Casts the value.

impl<Frac: LeEqU64> SaturatingCast<usize> for FixedU64<Frac>[src]

fn saturating_cast(self) -> usize[src]

Casts the value.

impl<Frac: LeEqU64> SaturatingMul for FixedU64<Frac>[src]

fn saturating_mul(&self, v: &Self) -> Self[src]

Saturating multiplication. Computes self * other, saturating at the relevant high or low boundary of the type. Read more

impl<Frac> SaturatingSub for FixedU64<Frac>[src]

fn saturating_sub(&self, v: &Self) -> Self[src]

Saturating subtraction. Computes self - other, saturating at the relevant high or low boundary of the type. Read more

impl<Frac: LeEqU64> Serialize for FixedU64<Frac>[src]

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>[src]

Serialize this value into the given Serde serializer. Read more

impl<Frac> Shl<&'_ i128> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &i128) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ i128> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &i128) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ i16> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &i16) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ i16> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &i16) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ i32> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &i32) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ i32> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &i32) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ i64> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &i64) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ i64> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &i64) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ i8> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &i8) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ i8> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &i8) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ isize> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &isize) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ isize> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &isize) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ u128> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &u128) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ u128> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &u128) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ u16> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &u16) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ u16> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &u16) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ u32> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &u32) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ u32> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &u32) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ u64> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &u64) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ u64> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &u64) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ u8> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &u8) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ u8> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &u8) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ usize> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &usize) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<&'_ usize> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: &usize) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<i128> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: i128) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<i128> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: i128) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<i16> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: i16) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<i16> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: i16) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<i32> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: i32) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<i32> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: i32) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<i64> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: i64) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<i64> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: i64) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<i8> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: i8) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<i8> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: i8) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<isize> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: isize) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<isize> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: isize) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<u128> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: u128) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<u128> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: u128) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<u16> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: u16) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<u16> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: u16) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<u32> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: u32) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<u32> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: u32) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<u64> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: u64) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<u64> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: u64) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<u8> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: u8) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<u8> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: u8) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<usize> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: usize) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> Shl<usize> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the << operator.

fn shl(self, rhs: usize) -> FixedU64<Frac>[src]

Performs the << operation. Read more

impl<Frac> ShlAssign<&'_ i128> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: &i128)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<&'_ i16> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: &i16)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<&'_ i32> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: &i32)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<&'_ i64> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: &i64)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<&'_ i8> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: &i8)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<&'_ isize> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: &isize)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<&'_ u128> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: &u128)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<&'_ u16> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: &u16)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<&'_ u32> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: &u32)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<&'_ u64> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: &u64)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<&'_ u8> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: &u8)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<&'_ usize> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: &usize)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<i128> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: i128)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<i16> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: i16)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<i32> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: i32)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<i64> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: i64)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<i8> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: i8)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<isize> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: isize)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<u128> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: u128)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<u16> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: u16)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<u32> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: u32)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<u64> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: u64)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<u8> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: u8)[src]

Performs the <<= operation. Read more

impl<Frac> ShlAssign<usize> for FixedU64<Frac>[src]

fn shl_assign(&mut self, rhs: usize)[src]

Performs the <<= operation. Read more

impl<Frac> Shr<&'_ i128> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &i128) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ i128> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &i128) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ i16> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &i16) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ i16> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &i16) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ i32> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &i32) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ i32> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &i32) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ i64> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &i64) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ i64> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &i64) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ i8> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &i8) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ i8> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &i8) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ isize> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &isize) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ isize> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &isize) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ u128> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &u128) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ u128> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &u128) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ u16> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &u16) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ u16> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &u16) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ u32> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &u32) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ u32> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &u32) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ u64> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &u64) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ u64> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &u64) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ u8> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &u8) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ u8> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &u8) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ usize> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &usize) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<&'_ usize> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: &usize) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<i128> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: i128) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<i128> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: i128) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<i16> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: i16) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<i16> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: i16) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<i32> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: i32) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<i32> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: i32) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<i64> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: i64) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<i64> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: i64) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<i8> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: i8) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<i8> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: i8) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<isize> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: isize) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<isize> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: isize) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<u128> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: u128) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<u128> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: u128) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<u16> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: u16) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<u16> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: u16) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<u32> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: u32) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<u32> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: u32) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<u64> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: u64) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<u64> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: u64) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<u8> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: u8) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<u8> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: u8) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<usize> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: usize) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> Shr<usize> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the >> operator.

fn shr(self, rhs: usize) -> FixedU64<Frac>[src]

Performs the >> operation. Read more

impl<Frac> ShrAssign<&'_ i128> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: &i128)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<&'_ i16> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: &i16)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<&'_ i32> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: &i32)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<&'_ i64> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: &i64)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<&'_ i8> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: &i8)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<&'_ isize> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: &isize)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<&'_ u128> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: &u128)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<&'_ u16> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: &u16)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<&'_ u32> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: &u32)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<&'_ u64> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: &u64)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<&'_ u8> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: &u8)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<&'_ usize> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: &usize)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<i128> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: i128)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<i16> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: i16)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<i32> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: i32)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<i64> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: i64)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<i8> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: i8)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<isize> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: isize)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<u128> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: u128)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<u16> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: u16)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<u32> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: u32)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<u64> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: u64)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<u8> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: u8)[src]

Performs the >>= operation. Read more

impl<Frac> ShrAssign<usize> for FixedU64<Frac>[src]

fn shr_assign(&mut self, rhs: usize)[src]

Performs the >>= operation. Read more

impl<Frac> Sub<&'_ FixedU64<Frac>> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the - operator.

fn sub(self, rhs: &FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the - operation. Read more

impl<Frac> Sub<&'_ FixedU64<Frac>> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the - operator.

fn sub(self, rhs: &FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the - operation. Read more

impl<Frac> Sub<FixedU64<Frac>> for FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the - operator.

fn sub(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the - operation. Read more

impl<Frac> Sub<FixedU64<Frac>> for &FixedU64<Frac>[src]

type Output = FixedU64<Frac>

The resulting type after applying the - operator.

fn sub(self, rhs: FixedU64<Frac>) -> FixedU64<Frac>[src]

Performs the - operation. Read more

impl<Frac> SubAssign<&'_ FixedU64<Frac>> for FixedU64<Frac>[src]

fn sub_assign(&mut self, rhs: &FixedU64<Frac>)[src]

Performs the -= operation. Read more

impl<Frac> SubAssign<FixedU64<Frac>> for FixedU64<Frac>[src]

fn sub_assign(&mut self, rhs: FixedU64<Frac>)[src]

Performs the -= operation. Read more

impl<'a, Frac: 'a> Sum<&'a FixedU64<Frac>> for FixedU64<Frac>[src]

fn sum<I>(iter: I) -> FixedU64<Frac> where
    I: Iterator<Item = &'a FixedU64<Frac>>, 
[src]

Method which takes an iterator and generates Self from the elements by “summing up” the items. Read more

impl<Frac> Sum<FixedU64<Frac>> for FixedU64<Frac>[src]

fn sum<I>(iter: I) -> FixedU64<Frac> where
    I: Iterator<Item = FixedU64<Frac>>, 
[src]

Method which takes an iterator and generates Self from the elements by “summing up” the items. Read more

impl<Frac: LeEqU64> ToFixed for FixedU64<Frac>[src]

fn to_fixed<F: Fixed>(self) -> F[src]

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.

fn checked_to_fixed<F: Fixed>(self) -> Option<F>[src]

Converts a fixed-point number if it fits, otherwise returns None.

Any extra fractional bits are discarded, which rounds towards −∞.

fn saturating_to_fixed<F: Fixed>(self) -> F[src]

Converts a fixed-point number, saturating if it does not fit.

Any extra fractional bits are discarded, which rounds towards −∞.

fn wrapping_to_fixed<F: Fixed>(self) -> F[src]

Converts a fixed-point number, wrapping if it does not fit.

Any extra fractional bits are discarded, which rounds towards −∞.

fn overflowing_to_fixed<F: Fixed>(self) -> (F, bool)[src]

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 −∞.

fn unwrapped_to_fixed<F: Fixed>(self) -> F[src]

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.

impl<Frac: LeEqU64> ToPrimitive for FixedU64<Frac>[src]

fn to_i64(&self) -> Option<i64>[src]

Converts the value of self to an i64. If the value cannot be represented by an i64, then None is returned. Read more

fn to_u64(&self) -> Option<u64>[src]

Converts the value of self to a u64. If the value cannot be represented by a u64, then None is returned. Read more

fn to_isize(&self) -> Option<isize>[src]

Converts the value of self to an isize. If the value cannot be represented by an isize, then None is returned. Read more

fn to_i8(&self) -> Option<i8>[src]

Converts the value of self to an i8. If the value cannot be represented by an i8, then None is returned. Read more

fn to_i16(&self) -> Option<i16>[src]

Converts the value of self to an i16. If the value cannot be represented by an i16, then None is returned. Read more

fn to_i32(&self) -> Option<i32>[src]

Converts the value of self to an i32. If the value cannot be represented by an i32, then None is returned. Read more

fn to_i128(&self) -> Option<i128>[src]

Converts the value of self to an i128. If the value cannot be represented by an i128 (i64 under the default implementation), then None is returned. Read more

fn to_usize(&self) -> Option<usize>[src]

Converts the value of self to a usize. If the value cannot be represented by a usize, then None is returned. Read more

fn to_u8(&self) -> Option<u8>[src]

Converts the value of self to a u8. If the value cannot be represented by a u8, then None is returned. Read more

fn to_u16(&self) -> Option<u16>[src]

Converts the value of self to a u16. If the value cannot be represented by a u16, then None is returned. Read more

fn to_u32(&self) -> Option<u32>[src]

Converts the value of self to a u32. If the value cannot be represented by a u32, then None is returned. Read more

fn to_u128(&self) -> Option<u128>[src]

Converts the value of self to a u128. If the value cannot be represented by a u128 (u64 under the default implementation), then None is returned. Read more

fn to_f32(&self) -> Option<f32>[src]

Converts the value of self to an f32. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f32. Read more

fn to_f64(&self) -> Option<f64>[src]

Converts the value of self to an f64. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f64. Read more

impl<Frac: LeEqU64> TransparentWrapper<FixedU64<Frac>> for Wrapping<FixedU64<Frac>>[src]

fn wrap_ref(s: &Wrapped) -> &Self[src]

Convert a reference to a wrapped type into a reference to the wrapper. Read more

fn wrap_mut(s: &mut Wrapped) -> &mut Self[src]

Convert a mut reference to a wrapped type into a mut reference to the wrapper. Read more

impl<Frac: LeEqU64> TransparentWrapper<FixedU64<Frac>> for Unwrapped<FixedU64<Frac>>[src]

fn wrap_ref(s: &Wrapped) -> &Self[src]

Convert a reference to a wrapped type into a reference to the wrapper. Read more

fn wrap_mut(s: &mut Wrapped) -> &mut Self[src]

Convert a mut reference to a wrapped type into a mut reference to the wrapper. Read more

impl<Frac> TransparentWrapper<u64> for FixedU64<Frac>[src]

fn wrap_ref(s: &Wrapped) -> &Self[src]

Convert a reference to a wrapped type into a reference to the wrapper. Read more

fn wrap_mut(s: &mut Wrapped) -> &mut Self[src]

Convert a mut reference to a wrapped type into a mut reference to the wrapper. Read more

impl<Frac: LeEqU64> UnwrappedCast<F128Bits> for FixedU64<Frac>[src]

fn unwrapped_cast(self) -> F128Bits[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU128> UnwrappedCast<FixedI128<FracDst>> for FixedU64<FracSrc>[src]

fn unwrapped_cast(self) -> FixedI128<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU16> UnwrappedCast<FixedI16<FracDst>> for FixedU64<FracSrc>[src]

fn unwrapped_cast(self) -> FixedI16<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU32> UnwrappedCast<FixedI32<FracDst>> for FixedU64<FracSrc>[src]

fn unwrapped_cast(self) -> FixedI32<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> UnwrappedCast<FixedI64<FracDst>> for FixedU64<FracSrc>[src]

fn unwrapped_cast(self) -> FixedI64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU8> UnwrappedCast<FixedI8<FracDst>> for FixedU64<FracSrc>[src]

fn unwrapped_cast(self) -> FixedI8<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU128> UnwrappedCast<FixedU128<FracDst>> for FixedU64<FracSrc>[src]

fn unwrapped_cast(self) -> FixedU128<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU16> UnwrappedCast<FixedU16<FracDst>> for FixedU64<FracSrc>[src]

fn unwrapped_cast(self) -> FixedU16<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU32> UnwrappedCast<FixedU32<FracDst>> for FixedU64<FracSrc>[src]

fn unwrapped_cast(self) -> FixedU32<FracDst>[src]

Casts the value.

impl<Frac: LeEqU64> UnwrappedCast<FixedU64<Frac>> for F128Bits[src]

fn unwrapped_cast(self) -> FixedU64<Frac>[src]

Casts the value.

impl<FracSrc: LeEqU8, FracDst: LeEqU64> UnwrappedCast<FixedU64<FracDst>> for FixedI8<FracSrc>[src]

fn unwrapped_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU16, FracDst: LeEqU64> UnwrappedCast<FixedU64<FracDst>> for FixedI16<FracSrc>[src]

fn unwrapped_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU32, FracDst: LeEqU64> UnwrappedCast<FixedU64<FracDst>> for FixedI32<FracSrc>[src]

fn unwrapped_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> UnwrappedCast<FixedU64<FracDst>> for FixedI64<FracSrc>[src]

fn unwrapped_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU128, FracDst: LeEqU64> UnwrappedCast<FixedU64<FracDst>> for FixedI128<FracSrc>[src]

fn unwrapped_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU8, FracDst: LeEqU64> UnwrappedCast<FixedU64<FracDst>> for FixedU8<FracSrc>[src]

fn unwrapped_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU16, FracDst: LeEqU64> UnwrappedCast<FixedU64<FracDst>> for FixedU16<FracSrc>[src]

fn unwrapped_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU32, FracDst: LeEqU64> UnwrappedCast<FixedU64<FracDst>> for FixedU32<FracSrc>[src]

fn unwrapped_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> UnwrappedCast<FixedU64<FracDst>> for FixedU64<FracSrc>[src]

fn unwrapped_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU128, FracDst: LeEqU64> UnwrappedCast<FixedU64<FracDst>> for FixedU128<FracSrc>[src]

fn unwrapped_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU8> UnwrappedCast<FixedU8<FracDst>> for FixedU64<FracSrc>[src]

fn unwrapped_cast(self) -> FixedU8<FracDst>[src]

Casts the value.

impl<Frac: LeEqU64> UnwrappedCast<bf16> for FixedU64<Frac>[src]

fn unwrapped_cast(self) -> bf16[src]

Casts the value.

impl<Frac: LeEqU64> UnwrappedCast<f16> for FixedU64<Frac>[src]

fn unwrapped_cast(self) -> f16[src]

Casts the value.

impl<Frac: LeEqU64> UnwrappedCast<f32> for FixedU64<Frac>[src]

fn unwrapped_cast(self) -> f32[src]

Casts the value.

impl<Frac: LeEqU64> UnwrappedCast<f64> for FixedU64<Frac>[src]

fn unwrapped_cast(self) -> f64[src]

Casts the value.

impl<Frac: LeEqU64> UnwrappedCast<i128> for FixedU64<Frac>[src]

fn unwrapped_cast(self) -> i128[src]

Casts the value.

impl<Frac: LeEqU64> UnwrappedCast<i16> for FixedU64<Frac>[src]

fn unwrapped_cast(self) -> i16[src]

Casts the value.

impl<Frac: LeEqU64> UnwrappedCast<i32> for FixedU64<Frac>[src]

fn unwrapped_cast(self) -> i32[src]

Casts the value.

impl<Frac: LeEqU64> UnwrappedCast<i64> for FixedU64<Frac>[src]

fn unwrapped_cast(self) -> i64[src]

Casts the value.

impl<Frac: LeEqU64> UnwrappedCast<i8> for FixedU64<Frac>[src]

fn unwrapped_cast(self) -> i8[src]

Casts the value.

impl<Frac: LeEqU64> UnwrappedCast<isize> for FixedU64<Frac>[src]

fn unwrapped_cast(self) -> isize[src]

Casts the value.

impl<Frac: LeEqU64> UnwrappedCast<u128> for FixedU64<Frac>[src]

fn unwrapped_cast(self) -> u128[src]

Casts the value.

impl<Frac: LeEqU64> UnwrappedCast<u16> for FixedU64<Frac>[src]

fn unwrapped_cast(self) -> u16[src]

Casts the value.

impl<Frac: LeEqU64> UnwrappedCast<u32> for FixedU64<Frac>[src]

fn unwrapped_cast(self) -> u32[src]

Casts the value.

impl<Frac: LeEqU64> UnwrappedCast<u64> for FixedU64<Frac>[src]

fn unwrapped_cast(self) -> u64[src]

Casts the value.

impl<Frac: LeEqU64> UnwrappedCast<u8> for FixedU64<Frac>[src]

fn unwrapped_cast(self) -> u8[src]

Casts the value.

impl<Frac: LeEqU64> UnwrappedCast<usize> for FixedU64<Frac>[src]

fn unwrapped_cast(self) -> usize[src]

Casts the value.

impl<Frac: LeEqU64> UpperHex for FixedU64<Frac>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult[src]

Formats the value using the given formatter.

impl<Frac> WrappingAdd for FixedU64<Frac>[src]

fn wrapping_add(&self, v: &Self) -> Self[src]

Wrapping (modular) addition. Computes self + other, wrapping around at the boundary of the type. Read more

impl<Frac: LeEqU64> WrappingCast<F128Bits> for FixedU64<Frac>[src]

fn wrapping_cast(self) -> F128Bits[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU128> WrappingCast<FixedI128<FracDst>> for FixedU64<FracSrc>[src]

fn wrapping_cast(self) -> FixedI128<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU16> WrappingCast<FixedI16<FracDst>> for FixedU64<FracSrc>[src]

fn wrapping_cast(self) -> FixedI16<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU32> WrappingCast<FixedI32<FracDst>> for FixedU64<FracSrc>[src]

fn wrapping_cast(self) -> FixedI32<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> WrappingCast<FixedI64<FracDst>> for FixedU64<FracSrc>[src]

fn wrapping_cast(self) -> FixedI64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU8> WrappingCast<FixedI8<FracDst>> for FixedU64<FracSrc>[src]

fn wrapping_cast(self) -> FixedI8<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU128> WrappingCast<FixedU128<FracDst>> for FixedU64<FracSrc>[src]

fn wrapping_cast(self) -> FixedU128<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU16> WrappingCast<FixedU16<FracDst>> for FixedU64<FracSrc>[src]

fn wrapping_cast(self) -> FixedU16<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU32> WrappingCast<FixedU32<FracDst>> for FixedU64<FracSrc>[src]

fn wrapping_cast(self) -> FixedU32<FracDst>[src]

Casts the value.

impl<Frac: LeEqU64> WrappingCast<FixedU64<Frac>> for F128Bits[src]

fn wrapping_cast(self) -> FixedU64<Frac>[src]

Casts the value.

impl<FracSrc: LeEqU8, FracDst: LeEqU64> WrappingCast<FixedU64<FracDst>> for FixedI8<FracSrc>[src]

fn wrapping_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU16, FracDst: LeEqU64> WrappingCast<FixedU64<FracDst>> for FixedI16<FracSrc>[src]

fn wrapping_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU32, FracDst: LeEqU64> WrappingCast<FixedU64<FracDst>> for FixedI32<FracSrc>[src]

fn wrapping_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> WrappingCast<FixedU64<FracDst>> for FixedI64<FracSrc>[src]

fn wrapping_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU128, FracDst: LeEqU64> WrappingCast<FixedU64<FracDst>> for FixedI128<FracSrc>[src]

fn wrapping_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU8, FracDst: LeEqU64> WrappingCast<FixedU64<FracDst>> for FixedU8<FracSrc>[src]

fn wrapping_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU16, FracDst: LeEqU64> WrappingCast<FixedU64<FracDst>> for FixedU16<FracSrc>[src]

fn wrapping_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU32, FracDst: LeEqU64> WrappingCast<FixedU64<FracDst>> for FixedU32<FracSrc>[src]

fn wrapping_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU64> WrappingCast<FixedU64<FracDst>> for FixedU64<FracSrc>[src]

fn wrapping_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU128, FracDst: LeEqU64> WrappingCast<FixedU64<FracDst>> for FixedU128<FracSrc>[src]

fn wrapping_cast(self) -> FixedU64<FracDst>[src]

Casts the value.

impl<FracSrc: LeEqU64, FracDst: LeEqU8> WrappingCast<FixedU8<FracDst>> for FixedU64<FracSrc>[src]

fn wrapping_cast(self) -> FixedU8<FracDst>[src]

Casts the value.

impl<Frac: LeEqU64> WrappingCast<bf16> for FixedU64<Frac>[src]

fn wrapping_cast(self) -> bf16[src]

Casts the value.

impl<Frac: LeEqU64> WrappingCast<f16> for FixedU64<Frac>[src]

fn wrapping_cast(self) -> f16[src]

Casts the value.

impl<Frac: LeEqU64> WrappingCast<f32> for FixedU64<Frac>[src]

fn wrapping_cast(self) -> f32[src]

Casts the value.

impl<Frac: LeEqU64> WrappingCast<f64> for FixedU64<Frac>[src]

fn wrapping_cast(self) -> f64[src]

Casts the value.

impl<Frac: LeEqU64> WrappingCast<i128> for FixedU64<Frac>[src]

fn wrapping_cast(self) -> i128[src]

Casts the value.

impl<Frac: LeEqU64> WrappingCast<i16> for FixedU64<Frac>[src]

fn wrapping_cast(self) -> i16[src]

Casts the value.

impl<Frac: LeEqU64> WrappingCast<i32> for FixedU64<Frac>[src]

fn wrapping_cast(self) -> i32[src]

Casts the value.

impl<Frac: LeEqU64> WrappingCast<i64> for FixedU64<Frac>[src]

fn wrapping_cast(self) -> i64[src]

Casts the value.

impl<Frac: LeEqU64> WrappingCast<i8> for FixedU64<Frac>[src]

fn wrapping_cast(self) -> i8[src]

Casts the value.

impl<Frac: LeEqU64> WrappingCast<isize> for FixedU64<Frac>[src]

fn wrapping_cast(self) -> isize[src]

Casts the value.

impl<Frac: LeEqU64> WrappingCast<u128> for FixedU64<Frac>[src]

fn wrapping_cast(self) -> u128[src]

Casts the value.

impl<Frac: LeEqU64> WrappingCast<u16> for FixedU64<Frac>[src]

fn wrapping_cast(self) -> u16[src]

Casts the value.

impl<Frac: LeEqU64> WrappingCast<u32> for FixedU64<Frac>[src]

fn wrapping_cast(self) -> u32[src]

Casts the value.

impl<Frac: LeEqU64> WrappingCast<u64> for FixedU64<Frac>[src]

fn wrapping_cast(self) -> u64[src]

Casts the value.

impl<Frac: LeEqU64> WrappingCast<u8> for FixedU64<Frac>[src]

fn wrapping_cast(self) -> u8[src]

Casts the value.

impl<Frac: LeEqU64> WrappingCast<usize> for FixedU64<Frac>[src]

fn wrapping_cast(self) -> usize[src]

Casts the value.

impl<Frac: LeEqU64> WrappingMul for FixedU64<Frac>[src]

fn wrapping_mul(&self, v: &Self) -> Self[src]

Wrapping (modular) multiplication. Computes self * other, wrapping around at the boundary of the type. Read more

impl<Frac> WrappingNeg for FixedU64<Frac>[src]

fn wrapping_neg(&self) -> Self[src]

Wrapping (modular) negation. Computes -self, wrapping around at the boundary of the type. Read more

impl<Frac> WrappingShl for FixedU64<Frac>[src]

fn wrapping_shl(&self, rhs: u32) -> Self[src]

Panic-free bitwise shift-left; yields self << mask(rhs), where mask removes any high order bits of rhs that would cause the shift to exceed the bitwidth of the type. Read more

impl<Frac> WrappingShr for FixedU64<Frac>[src]

fn wrapping_shr(&self, rhs: u32) -> Self[src]

Panic-free bitwise shift-right; yields self >> mask(rhs), where mask removes any high order bits of rhs that would cause the shift to exceed the bitwidth of the type. Read more

impl<Frac> WrappingSub for FixedU64<Frac>[src]

fn wrapping_sub(&self, v: &Self) -> Self[src]

Wrapping (modular) subtraction. Computes self - other, wrapping around at the boundary of the type. Read more

impl<Frac> Zero for FixedU64<Frac>[src]

fn zero() -> Self[src]

Returns the additive identity element of Self, 0. Read more

fn is_zero(&self) -> bool[src]

Returns true if self is equal to the additive identity.

fn set_zero(&mut self)[src]

Sets self to the additive identity element of Self, 0.

impl<Frac> Zeroable for FixedU64<Frac>[src]

fn zeroed() -> Self[src]

impl<Frac> Copy for FixedU64<Frac>[src]

impl<Frac: LeEqU64> Eq for FixedU64<Frac>[src]

impl<Frac: LeEqU64> FixedOptionalFeatures for FixedU64<Frac>[src]

impl<Frac: 'static> Pod for FixedU64<Frac>[src]

impl<Frac: LeEqU64> Unsigned for FixedU64<Frac> where
    Frac: IsLessOrEqual<U63, Output = True>, 
[src]

Auto Trait Implementations

impl<Frac> RefUnwindSafe for FixedU64<Frac> where
    Frac: RefUnwindSafe

impl<Frac> Send for FixedU64<Frac> where
    Frac: Send

impl<Frac> Sync for FixedU64<Frac> where
    Frac: Sync

impl<Frac> Unpin for FixedU64<Frac> where
    Frac: Unpin

impl<Frac> UnwindSafe for FixedU64<Frac> where
    Frac: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Az for T[src]

pub fn az<Dst>(self) -> Dst where
    T: Cast<Dst>, 
[src]

Casts the value.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> CheckedAs for T[src]

pub fn checked_as<Dst>(self) -> Option<Dst> where
    T: CheckedCast<Dst>, 
[src]

Casts the value.

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<Src, Dst> LosslessTryInto<Dst> for Src where
    Dst: LosslessTryFrom<Src>, 
[src]

pub fn lossless_try_into(Self) -> Option<Dst>[src]

Performs the conversion.

impl<Src, Dst> LossyInto<Dst> for Src where
    Dst: LossyFrom<Src>, 
[src]

pub fn lossy_into(Self) -> Dst[src]

Performs the conversion.

impl<T> OverflowingAs for T[src]

pub fn overflowing_as<Dst>(self) -> (Dst, bool) where
    T: OverflowingCast<Dst>, 
[src]

Casts the value.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> SaturatingAs for T[src]

pub fn saturating_as<Dst>(self) -> Dst where
    T: SaturatingCast<Dst>, 
[src]

Casts the value.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

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

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T> UnwrappedAs for T[src]

pub fn unwrapped_as<Dst>(self) -> Dst where
    T: UnwrappedCast<Dst>, 
[src]

Casts the value.

impl<T> WrappingAs for T[src]

pub fn wrapping_as<Dst>(self) -> Dst where
    T: WrappingCast<Dst>, 
[src]

Casts the value.

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> NumAssign for T where
    T: Num + NumAssignOps<T>, 
[src]

impl<T, Rhs> NumAssignOps<Rhs> for T where
    T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>, 
[src]

impl<T> NumAssignRef for T where
    T: NumAssign + for<'r> NumAssignOps<&'r T>, 
[src]

impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
    T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, 
[src]

impl<T> NumRef for T where
    T: Num + for<'r> NumOps<&'r T, T>, 
[src]

impl<T, Base> RefNum<Base> for T where
    T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>, 
[src]