Struct decstr::Bitstring32
source · pub struct Bitstring32(_);
Expand description
Implementations§
source§impl Bitstring32
impl Bitstring32
Basic mathematical constants.
sourcepub const FRAC_2_SQRT_PI: Self = _
pub const FRAC_2_SQRT_PI: Self = _
2/sqrt(π)
sourcepub const FRAC_1_SQRT_2: Self = _
pub const FRAC_1_SQRT_2: Self = _
1/sqrt(2)
source§impl Bitstring32
impl Bitstring32
sourcepub const DIGITS: u32 = 7u32
pub const DIGITS: u32 = 7u32
The number of digits in base 10 that can be represented without loss of precision.
This constant indicates the total count of significant decimal digits in the
significand, regardless of the decimal point’s position. For instance
1234567 and 123.4567, both contain DIGITS
digits.
sourcepub const EPSILON: Self = _
pub const EPSILON: Self = _
Machine epsilon value.
This is the difference between 1.0
and the next larger representable number.
sourcepub const MIN_POSITIVE: Self = _
pub const MIN_POSITIVE: Self = _
Smallest positive normal value.
sourcepub const MIN_10_EXP: i32 = -101i32
pub const MIN_10_EXP: i32 = -101i32
Minimum possible normal power of 10 exponent.
sourcepub const MAX_10_EXP: i32 = 90i32
pub const MAX_10_EXP: i32 = 90i32
Maximum possible normal power of 10 exponent.
sourcepub const NEG_INFINITY: Self = _
pub const NEG_INFINITY: Self = _
Negative infinity (−∞).
source§impl Bitstring32
impl Bitstring32
sourcepub const fn from_le_bytes(bytes: [u8; 4]) -> Self
pub const fn from_le_bytes(bytes: [u8; 4]) -> Self
Create a decimal from its representation as a byte array in little endian.
This matches the internal byte representation of the decimal, regardless of the platform.
sourcepub const fn from_be_bytes(bytes: [u8; 4]) -> Self
pub const fn from_be_bytes(bytes: [u8; 4]) -> Self
Create a decimal from its representation as a byte array in big endian.
sourcepub const fn as_le_bytes(&self) -> &[u8; 4]
pub const fn as_le_bytes(&self) -> &[u8; 4]
Return the memory representation of this decimal as a byte array in little-endian byte order.
This matches the internal byte representation of the decimal, regardless of the platform.
sourcepub const fn to_be_bytes(&self) -> [u8; 4]
pub const fn to_be_bytes(&self) -> [u8; 4]
Return the memory representation of this decimal as a byte array in big-endian (network) byte order.
sourcepub fn min_positive() -> Self
pub fn min_positive() -> Self
Create a decimal with its minimum positive non-zero value.
source§impl Bitstring32
impl Bitstring32
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 Bitstring32
impl Bitstring32
sourcepub fn try_parse_str(s: &str) -> Result<Bitstring32, Error>
pub fn try_parse_str(s: &str) -> Result<Bitstring32, 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 Bitstring32
impl Bitstring32
sourcepub fn from_f32(f: f32) -> Option<Bitstring32>
pub fn from_f32(f: f32) -> Option<Bitstring32>
Try convert a binary floating point into a decimal.
source§impl Bitstring32
impl Bitstring32
sourcepub fn from_f64(f: f64) -> Option<Bitstring32>
pub fn from_f64(f: f64) -> Option<Bitstring32>
Try convert a binary floating point into a decimal.
source§impl Bitstring32
impl Bitstring32
source§impl Bitstring32
impl Bitstring32
source§impl Bitstring32
impl Bitstring32
sourcepub fn from_i8(i: i8) -> Bitstring32
pub fn from_i8(i: i8) -> Bitstring32
Convert an integer into a decimal.
source§impl Bitstring32
impl Bitstring32
sourcepub fn from_i16(i: i16) -> Bitstring32
pub fn from_i16(i: i16) -> Bitstring32
Convert an integer into a decimal.
source§impl Bitstring32
impl Bitstring32
sourcepub fn from_i32(i: i32) -> Option<Bitstring32>
pub fn from_i32(i: i32) -> Option<Bitstring32>
Try convert an integer into a decimal.
source§impl Bitstring32
impl Bitstring32
sourcepub fn from_i64(i: i64) -> Option<Bitstring32>
pub fn from_i64(i: i64) -> Option<Bitstring32>
Try convert an integer into a decimal.
source§impl Bitstring32
impl Bitstring32
sourcepub fn from_i128(i: i128) -> Option<Bitstring32>
pub fn from_i128(i: i128) -> Option<Bitstring32>
Try convert an integer into a decimal.
source§impl Bitstring32
impl Bitstring32
source§impl Bitstring32
impl Bitstring32
source§impl Bitstring32
impl Bitstring32
source§impl Bitstring32
impl Bitstring32
source§impl Bitstring32
impl Bitstring32
source§impl Bitstring32
impl Bitstring32
sourcepub fn from_u8(i: u8) -> Bitstring32
pub fn from_u8(i: u8) -> Bitstring32
Convert an integer into a decimal.
source§impl Bitstring32
impl Bitstring32
sourcepub fn from_u16(i: u16) -> Bitstring32
pub fn from_u16(i: u16) -> Bitstring32
Convert an integer into a decimal.
source§impl Bitstring32
impl Bitstring32
sourcepub fn from_u32(i: u32) -> Option<Bitstring32>
pub fn from_u32(i: u32) -> Option<Bitstring32>
Try convert an integer into a decimal.
source§impl Bitstring32
impl Bitstring32
sourcepub fn from_u64(i: u64) -> Option<Bitstring32>
pub fn from_u64(i: u64) -> Option<Bitstring32>
Try convert an integer into a decimal.
source§impl Bitstring32
impl Bitstring32
sourcepub fn from_u128(i: u128) -> Option<Bitstring32>
pub fn from_u128(i: u128) -> Option<Bitstring32>
Try convert an integer into a decimal.
source§impl Bitstring32
impl Bitstring32
source§impl Bitstring32
impl Bitstring32
source§impl Bitstring32
impl Bitstring32
source§impl Bitstring32
impl Bitstring32
Trait Implementations§
source§impl Clone for Bitstring32
impl Clone for Bitstring32
source§fn clone(&self) -> Bitstring32
fn clone(&self) -> Bitstring32
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more