pub struct SignExpansionEncoder { /* private fields */ }Expand description
Encoder and decoder for surreal sign-expansion sequences.
The sign expansion of a surreal number x is a sequence of +/- signs obtained by walking the surreal tree from the root (0) to x:
-
- means “x is to the right of the current node” (x > current)
-
- means “x is to the left of the current node” (x < current)
Implementations§
Source§impl SignExpansionEncoder
impl SignExpansionEncoder
Sourcepub fn from_fin_surreal(x: &FinSurreal) -> Self
pub fn from_fin_surreal(x: &FinSurreal) -> Self
Encode a dyadic rational as its sign expansion.
Sourcepub fn decode(&self) -> FinSurreal
pub fn decode(&self) -> FinSurreal
Decode the sign sequence back to a dyadic rational approximation.
Trait Implementations§
Source§impl Clone for SignExpansionEncoder
impl Clone for SignExpansionEncoder
Source§fn clone(&self) -> SignExpansionEncoder
fn clone(&self) -> SignExpansionEncoder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SignExpansionEncoder
impl Debug for SignExpansionEncoder
Auto Trait Implementations§
impl Freeze for SignExpansionEncoder
impl RefUnwindSafe for SignExpansionEncoder
impl Send for SignExpansionEncoder
impl Sync for SignExpansionEncoder
impl Unpin for SignExpansionEncoder
impl UnsafeUnpin for SignExpansionEncoder
impl UnwindSafe for SignExpansionEncoder
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