[−][src]Struct bigbit::headbyte::HBNum
The Head Byte format, capable of storing integers and decimal fractions up to ±1.34078079e+281.
See the module-level documentation for more.
Implementations
impl HBNum
[src]
pub fn from_raw_parts(
hb: HeadByte,
exponent: Option<Exponent>,
coefficients: Vec<u8>
) -> Self
[src]
hb: HeadByte,
exponent: Option<Exponent>,
coefficients: Vec<u8>
) -> Self
Constructs a new HBNum
from the head byte, exponent and the coefficients.
The length of the coefficient storage and the presence of the exponent override the value in the head byte. If the head byte cannot fit the total number of bytes, this call panics.
pub const fn headbyte(&self) -> HeadByte
[src]
Returns the head byte.
The results of inspecting the head byte are reliable and always match the properties of the actual value of the entire number. For example, if has_exponent
on the head byte always returns true
, there always is an exponent byte to retreieve.
pub const fn exponent(&self) -> Option<Exponent>
[src]
Returns the exponent, or None
if it's not used (mainly the case for integers).
pub fn coefficient_le_iter(
&self
) -> impl Iterator<Item = u8> + DoubleEndedIterator + '_
[src]
&self
) -> impl Iterator<Item = u8> + DoubleEndedIterator + '_
Returns an iterator over the coefficients in little endian byte order.
pub fn coefficient_be_iter(
&self
) -> impl Iterator<Item = u8> + DoubleEndedIterator + '_
[src]
&self
) -> impl Iterator<Item = u8> + DoubleEndedIterator + '_
Returns an iterator over the coefficients in big endian byte order.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for HBNum
impl Send for HBNum
impl Sync for HBNum
impl Unpin for HBNum
impl UnwindSafe for HBNum
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,