pub struct Real {
pub negative: bool,
pub digits: [u8; 12],
pub exponent: i32,
}Expand description
A real number exactly as the calculator stores it: sign, 12 decimal digits with the point after the first, exponent -499..=499.
Fields§
§negative: boolNegative.
digits: [u8; 12]Mantissa digits, most significant first; the first is nonzero unless the number is 0.
exponent: i32Decimal exponent.
Implementations§
Source§impl Real
impl Real
Sourcepub fn from_body(body: &[u8]) -> Result<Real>
pub fn from_body(body: &[u8]) -> Result<Real>
Decode a 16-nibble real body: 3-nibble tens-complement exponent, 12 mantissa digits from the least significant up, sign (0 or 9).
Sourcepub fn to_source(&self) -> String
pub fn to_source(&self) -> String
RPL source that compiles to exactly this real: 5., -1.5E-300,
4.79425538604E-1.
Trait Implementations§
impl Copy for Real
Source§impl<'de> Deserialize<'de> for Real
impl<'de> Deserialize<'de> for Real
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Real, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Real, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Real
impl StructuralPartialEq for Real
Auto Trait Implementations§
impl Freeze for Real
impl RefUnwindSafe for Real
impl Send for Real
impl Sync for Real
impl Unpin for Real
impl UnsafeUnpin for Real
impl UnwindSafe for Real
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