Struct decstr::BigBitstring
source · pub struct BigBitstring(_);
Expand description
An arbitrary precision decimal number.
This type is only available when the arbitrary-precision
feature is enabled.
Implementations§
source§impl BigBitstring
impl BigBitstring
sourcepub fn try_from_le_bytes(bytes: &[u8]) -> Result<Self, Error>
pub fn try_from_le_bytes(bytes: &[u8]) -> Result<Self, Error>
Try create a decimal from the given buffer.
The buffer is assumed to be in little-endian byte-order already. This method will fail if the buffer length is not a multiple of 4 bytes.
sourcepub fn as_le_bytes(&self) -> &[u8] ⓘ
pub fn as_le_bytes(&self) -> &[u8] ⓘ
Get a reference to the underlying bitstring buffer.
This buffer is always stored in little-endian byte-order, regardless of the endianness of the platform.
source§impl BigBitstring
impl BigBitstring
sourcepub fn is_sign_negative(&self) -> bool
pub fn is_sign_negative(&self) -> bool
Whether or not the sign bit is set.
sourcepub fn is_infinite(&self) -> bool
pub fn is_infinite(&self) -> bool
Whether or not the decimal is an infinity.
sourcepub fn is_quiet_nan(&self) -> bool
pub fn is_quiet_nan(&self) -> bool
Whether the decimal is a qNaN.
sourcepub fn is_signaling_nan(&self) -> bool
pub fn is_signaling_nan(&self) -> bool
Whether the decimal is a sNaN.
source§impl BigBitstring
impl BigBitstring
sourcepub fn try_parse_str(s: &str) -> Result<BigBitstring, Error>
pub fn try_parse_str(s: &str) -> Result<BigBitstring, Error>
Try parse a decimal from a string.
This method is more efficient than try_parse
if you already have a string to parse.
source§impl BigBitstring
impl BigBitstring
sourcepub fn from_f32(f: f32) -> BigBitstring
pub fn from_f32(f: f32) -> BigBitstring
Convert a binary floating point into a decimal.
source§impl BigBitstring
impl BigBitstring
sourcepub fn from_f64(f: f64) -> BigBitstring
pub fn from_f64(f: f64) -> BigBitstring
Convert a binary floating point into a decimal.
source§impl BigBitstring
impl BigBitstring
source§impl BigBitstring
impl BigBitstring
source§impl BigBitstring
impl BigBitstring
sourcepub fn from_i8(i: i8) -> BigBitstring
pub fn from_i8(i: i8) -> BigBitstring
Convert an integer into a decimal.
source§impl BigBitstring
impl BigBitstring
sourcepub fn from_i16(i: i16) -> BigBitstring
pub fn from_i16(i: i16) -> BigBitstring
Convert an integer into a decimal.
source§impl BigBitstring
impl BigBitstring
sourcepub fn from_i32(i: i32) -> BigBitstring
pub fn from_i32(i: i32) -> BigBitstring
Convert an integer into a decimal.
source§impl BigBitstring
impl BigBitstring
sourcepub fn from_i64(i: i64) -> BigBitstring
pub fn from_i64(i: i64) -> BigBitstring
Convert an integer into a decimal.
source§impl BigBitstring
impl BigBitstring
sourcepub fn from_i128(i: i128) -> BigBitstring
pub fn from_i128(i: i128) -> BigBitstring
Convert an integer into a decimal.
source§impl BigBitstring
impl BigBitstring
source§impl BigBitstring
impl BigBitstring
source§impl BigBitstring
impl BigBitstring
source§impl BigBitstring
impl BigBitstring
source§impl BigBitstring
impl BigBitstring
source§impl BigBitstring
impl BigBitstring
sourcepub fn from_u8(i: u8) -> BigBitstring
pub fn from_u8(i: u8) -> BigBitstring
Convert an integer into a decimal.
source§impl BigBitstring
impl BigBitstring
sourcepub fn from_u16(i: u16) -> BigBitstring
pub fn from_u16(i: u16) -> BigBitstring
Convert an integer into a decimal.
source§impl BigBitstring
impl BigBitstring
sourcepub fn from_u32(i: u32) -> BigBitstring
pub fn from_u32(i: u32) -> BigBitstring
Convert an integer into a decimal.
source§impl BigBitstring
impl BigBitstring
sourcepub fn from_u64(i: u64) -> BigBitstring
pub fn from_u64(i: u64) -> BigBitstring
Convert an integer into a decimal.
source§impl BigBitstring
impl BigBitstring
sourcepub fn from_u128(i: u128) -> BigBitstring
pub fn from_u128(i: u128) -> BigBitstring
Convert an integer into a decimal.