[−][src]Struct sp_runtime::Fixed64
Re-export top-level arithmetic stuff. An unsigned fixed point number. Can hold any value in the range [-9_223_372_036, 9_223_372_036] with fixed point accuracy of one billion.
Implementations
impl Fixed64
[src]
Re-export top-level arithmetic stuff.
pub fn from_natural(int: i64) -> Fixed64
[src]
creates self from a natural number.
Note that this might be lossy.
pub fn accuracy() -> i64
[src]
Return the accuracy of the type. Given that this function returns the value X
, it means
that an instance composed of X
parts (Fixed64::from_parts(X)
) is equal to 1
.
pub fn into_inner(self) -> i64
[src]
Consume self and return the inner value.
pub fn from_parts(parts: i64) -> Fixed64
[src]
Raw constructor. Equal to parts / 1_000_000_000
.
pub fn from_rational(n: i64, d: u64) -> Fixed64
[src]
creates self from a rational number. Equal to n/d
.
Note that this might be lossy.
pub fn saturated_multiply_accumulate<N>(self, int: N) -> N where
N: TryFrom<u64> + From<u32> + UniqueSaturatedInto<u32> + Bounded + Clone + Saturating + Rem<N, Output = N> + Div<N, Output = N> + Mul<N, Output = N> + Add<N, Output = N>,
[src]
N: TryFrom<u64> + From<u32> + UniqueSaturatedInto<u32> + Bounded + Clone + Saturating + Rem<N, Output = N> + Div<N, Output = N> + Mul<N, Output = N> + Add<N, Output = N>,
Performs a saturated multiply and accumulate by unsigned number.
Returns a saturated int + (self * int)
.
pub fn is_negative(&self) -> bool
[src]
Trait Implementations
impl Add<Fixed64> for Fixed64
[src]
Use Saturating
trait for safe addition.
type Output = Fixed64
The resulting type after applying the +
operator.
fn add(self, rhs: Fixed64) -> <Fixed64 as Add<Fixed64>>::Output
[src]
impl CheckedAdd for Fixed64
[src]
fn checked_add(&self, rhs: &Fixed64) -> Option<Fixed64>
[src]
impl CheckedDiv for Fixed64
[src]
fn checked_div(&self, rhs: &Fixed64) -> Option<Fixed64>
[src]
impl CheckedSub for Fixed64
[src]
fn checked_sub(&self, rhs: &Fixed64) -> Option<Fixed64>
[src]
impl Clone for Fixed64
[src]
impl Copy for Fixed64
[src]
impl Debug for Fixed64
[src]
impl Decode for Fixed64
[src]
impl Default for Fixed64
[src]
impl Div<Fixed64> for Fixed64
[src]
Use CheckedDiv
trait for safe division.
type Output = Fixed64
The resulting type after applying the /
operator.
fn div(self, rhs: Fixed64) -> <Fixed64 as Div<Fixed64>>::Output
[src]
impl Encode for Fixed64
[src]
fn encode_to<EncOut>(&self, dest: &mut EncOut) where
EncOut: Output,
[src]
EncOut: Output,
fn encode(&self) -> Vec<u8>
[src]
fn using_encoded<R, F>(&self, f: F) -> R where
F: FnOnce(&[u8]) -> R,
[src]
F: FnOnce(&[u8]) -> R,
fn size_hint(&self) -> usize
[src]
impl EncodeLike<Fixed64> for Fixed64
[src]
impl Eq for Fixed64
[src]
impl Ord for Fixed64
[src]
fn cmp(&self, other: &Fixed64) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Fixed64> for Fixed64
[src]
impl PartialOrd<Fixed64> for Fixed64
[src]
fn partial_cmp(&self, other: &Fixed64) -> Option<Ordering>
[src]
fn lt(&self, other: &Fixed64) -> bool
[src]
fn le(&self, other: &Fixed64) -> bool
[src]
fn gt(&self, other: &Fixed64) -> bool
[src]
fn ge(&self, other: &Fixed64) -> bool
[src]
impl Saturating for Fixed64
[src]
fn saturating_add(self, rhs: Fixed64) -> Fixed64
[src]
fn saturating_mul(self, rhs: Fixed64) -> Fixed64
[src]
fn saturating_sub(self, rhs: Fixed64) -> Fixed64
[src]
fn saturating_pow(self, exp: usize) -> Fixed64
[src]
impl StructuralEq for Fixed64
[src]
impl StructuralPartialEq for Fixed64
[src]
impl Sub<Fixed64> for Fixed64
[src]
Use Saturating
trait for safe subtraction.
Auto Trait Implementations
impl RefUnwindSafe for Fixed64
impl Send for Fixed64
impl Sync for Fixed64
impl Unpin for Fixed64
impl UnwindSafe for Fixed64
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CheckedConversion for T
[src]
fn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
[src]
Self: TryFrom<T>,
fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
[src]
Self: TryInto<T>,
impl<T> Clear for T where
T: PartialEq<T> + Eq + Default,
[src]
T: PartialEq<T> + Eq + Default,
impl<T> Clear for T where
T: InitializableFromZeroed + ?Sized,
T: InitializableFromZeroed + ?Sized,
fn clear(&mut self)
impl<S> Codec for S where
S: Encode + Decode,
[src]
S: Encode + Decode,
impl<T, X> Decode for X where
T: Decode + Into<X>,
X: WrapperTypeDecode<Wrapped = T>,
[src]
T: Decode + Into<X>,
X: WrapperTypeDecode<Wrapped = T>,
impl<T> DecodeAll for T where
T: Decode,
[src]
T: Decode,
impl<T, X> Encode for X where
T: Encode + ?Sized,
X: WrapperTypeEncode<Target = T>,
[src]
T: Encode + ?Sized,
X: WrapperTypeEncode<Target = T>,
fn size_hint(&self) -> usize
[src]
fn using_encoded<R, F>(&self, f: F) -> R where
F: FnOnce(&[u8]) -> R,
[src]
F: FnOnce(&[u8]) -> R,
fn encode(&self) -> Vec<u8>
[src]
fn encode_to<W>(&self, dest: &mut W) where
W: Output,
[src]
W: Output,
impl<'_, '_, T> EncodeLike<&'_ &'_ T> for T where
T: Encode,
[src]
T: Encode,
impl<'_, T> EncodeLike<&'_ T> for T where
T: Encode,
[src]
T: Encode,
impl<'_, T> EncodeLike<&'_ mut T> for T where
T: Encode,
[src]
T: Encode,
impl<T> EncodeLike<Arc<T>> for T where
T: Encode,
[src]
T: Encode,
impl<T> EncodeLike<Box<T>> for T where
T: Encode,
[src]
T: Encode,
impl<'a, T> EncodeLike<Cow<'a, T>> for T where
T: Encode + ToOwned,
[src]
T: Encode + ToOwned,
impl<T> EncodeLike<Rc<T>> for T where
T: Encode,
[src]
T: Encode,
impl<T> From<T> for T
[src]
impl<S> FullCodec for S where
S: Decode + FullEncode,
[src]
S: Decode + FullEncode,
impl<S> FullEncode for S where
S: Encode + EncodeLike<S>,
[src]
S: Encode + EncodeLike<S>,
impl<T> InitializableFromZeroed for T where
T: Default,
T: Default,
unsafe fn initialize(place: *mut T)
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
[src]
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
fn from_ref(outer: &Outer) -> &T
[src]
Get a reference to the inner from the outer.
fn from_mut(outer: &mut Outer) -> &mut T
[src]
Get a mutable reference to the inner from the outer.
impl<T> KeyedVec for T where
T: Codec,
[src]
T: Codec,
impl<T> MaybeDebug for T where
T: Debug,
T: Debug,
impl<T> MaybeDebug for T where
T: Debug,
T: Debug,
impl<T> MaybeRefUnwindSafe for T where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Member for T where
T: 'static + Clone + PartialEq<T> + Eq + Send + Sync + Debug,
[src]
T: 'static + Clone + PartialEq<T> + Eq + Send + Sync + Debug,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> SaturatedConversion for T
[src]
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
[src]
Self: UniqueSaturatedFrom<T>,
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
[src]
Self: UniqueSaturatedInto<T>,
impl<T> Saturating for T where
T: Clone + PartialOrd<T> + Bounded + Zero + One + CheckedMul + Saturating,
[src]
T: Clone + PartialOrd<T> + Bounded + Zero + One + CheckedMul + Saturating,
fn saturating_add(self, o: T) -> T
[src]
fn saturating_sub(self, o: T) -> T
[src]
fn saturating_mul(self, o: T) -> T
[src]
fn saturating_pow(self, exp: usize) -> T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
[src]
T: UncheckedFrom<S>,
fn unchecked_into(self) -> T
[src]
impl<T, S> UniqueSaturatedInto<T> for S where
S: TryInto<T>,
T: Bounded,
[src]
S: TryInto<T>,
T: Bounded,
fn unique_saturated_into(self) -> T
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,