pub struct FixedPoint32 {
pub value: u64,
}
Expand description
Define a fixed-point numeric type with 32 fractional bits. This is just a u64 integer but it is wrapped in a struct to make a unique type. This is a binary representation, so decimal values may not be exactly representable, but it provides more than 9 decimal digits of precision both before and after the decimal point (18 digits total). For comparison, double precision floating-point has less than 16 decimal digits of precision, so be careful about using floating-point to convert these values to decimal.
Fields§
§value: u64
Implementations§
Source§impl FixedPoint32
impl FixedPoint32
pub fn move_instance(self) -> MoveInstance<Self>
pub fn type_() -> FixedPoint32TypeTag
Trait Implementations§
Source§impl Clone for FixedPoint32
impl Clone for FixedPoint32
Source§fn clone(&self) -> FixedPoint32
fn clone(&self) -> FixedPoint32
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FixedPoint32
impl Debug for FixedPoint32
Source§impl<'de> Deserialize<'de> for FixedPoint32
impl<'de> Deserialize<'de> for FixedPoint32
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for FixedPoint32
impl Display for FixedPoint32
Source§impl Hash for FixedPoint32
impl Hash for FixedPoint32
Source§impl MoveStruct for FixedPoint32
impl MoveStruct for FixedPoint32
Source§impl MoveType for FixedPoint32
impl MoveType for FixedPoint32
Source§impl PartialEq for FixedPoint32
impl PartialEq for FixedPoint32
Source§impl Serialize for FixedPoint32
impl Serialize for FixedPoint32
Source§impl StaticAddress for FixedPoint32
impl StaticAddress for FixedPoint32
Source§impl StaticModule for FixedPoint32
impl StaticModule for FixedPoint32
fn module() -> Identifier
Source§impl StaticName for FixedPoint32
impl StaticName for FixedPoint32
fn name() -> Identifier
Source§impl StaticTypeParams for FixedPoint32
impl StaticTypeParams for FixedPoint32
fn type_params() -> Vec<TypeTag>
Source§impl Tabled for FixedPoint32
impl Tabled for FixedPoint32
impl Eq for FixedPoint32
impl StructuralPartialEq for FixedPoint32
Auto Trait Implementations§
impl Freeze for FixedPoint32
impl RefUnwindSafe for FixedPoint32
impl Send for FixedPoint32
impl Sync for FixedPoint32
impl Unpin for FixedPoint32
impl UnwindSafe for FixedPoint32
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more