pub struct Decimal32 { /* private fields */ }
Expand description
A 32-bit decimal floating-point number.
Implementations§
source§impl Decimal32
impl Decimal32
sourcepub fn from_le_bytes(bytes: [u8; 4]) -> Decimal32
pub fn from_le_bytes(bytes: [u8; 4]) -> Decimal32
Creates a number from its representation as a little-endian byte array.
sourcepub fn from_be_bytes(bytes: [u8; 4]) -> Decimal32
pub fn from_be_bytes(bytes: [u8; 4]) -> Decimal32
Creates a number from its representation as a big-endian byte array.
sourcepub const fn from_ne_bytes(bytes: [u8; 4]) -> Decimal32
pub const fn from_ne_bytes(bytes: [u8; 4]) -> Decimal32
Creates a number from its representation as a byte array in the native endianness of the target platform.
sourcepub fn to_le_bytes(&self) -> [u8; 4]
pub fn to_le_bytes(&self) -> [u8; 4]
Returns the memory representation of the number as a byte array in little-endian order.
sourcepub fn to_be_bytes(&self) -> [u8; 4]
pub fn to_be_bytes(&self) -> [u8; 4]
Returns the memory representation of the number as a byte array in big-endian order.
sourcepub fn to_ne_bytes(&self) -> [u8; 4]
pub fn to_ne_bytes(&self) -> [u8; 4]
Returns the memory representation of the number as a byte array in the native endianness of the target platform.
sourcepub fn coefficient(&self) -> i32
pub fn coefficient(&self) -> i32
Computes the coefficient of the number.
If the number is a special value (i.e., NaN or infinity), returns zero.
Trait Implementations§
source§impl From<Decimal32> for Decimal128
impl From<Decimal32> for Decimal128
source§fn from(d32: Decimal32) -> Decimal128
fn from(d32: Decimal32) -> Decimal128
Converts to this type from the input type.
source§impl<D> From<Decimal32> for OrderedDecimal<D>
impl<D> From<Decimal32> for OrderedDecimal<D>
source§fn from(n: Decimal32) -> OrderedDecimal<D>
fn from(n: Decimal32) -> OrderedDecimal<D>
Converts to this type from the input type.
impl Copy for Decimal32
Auto Trait Implementations§
impl Freeze for Decimal32
impl RefUnwindSafe for Decimal32
impl Send for Decimal32
impl Sync for Decimal32
impl Unpin for Decimal32
impl UnwindSafe for Decimal32
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)