pub struct InRadix<'a> { /* private fields */ }
Expand description
Representation of a UBig or IBig in any radix between MIN_RADIX and MAX_RADIX inclusive.
This can be used to format a number in a non-standard radix, by calling UBig::in_radix or IBig::in_radix.
The default format uses lower-case letters a-z for digits 10-35.
The “alternative” format ({:#}
) uses upper-case letters.
§Examples
assert_eq!(format!("{}", UBig::from(83u8).in_radix(3)), "10002");
assert_eq!(format!("{:+010}", UBig::from(35u8).in_radix(36)), "+00000000z");
// For bases 2, 8, 10, 16 we don't have to use `InRadix`:
assert_eq!(format!("{:x}", UBig::from(3000u32)), "bb8");
assert_eq!(format!("{:#X}", IBig::from(-3000)), "-0xBB8");
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for InRadix<'a>
impl<'a> RefUnwindSafe for InRadix<'a>
impl<'a> Send for InRadix<'a>
impl<'a> Sync for InRadix<'a>
impl<'a> Unpin for InRadix<'a>
impl<'a> UnwindSafe for InRadix<'a>
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