Trait malachite_base::num::conversion::traits::ToStringBase
source · [−]pub trait ToStringBase {
fn to_string_base(&self, base: u8) -> String;
fn to_string_base_upper(&self, base: u8) -> String;
}
Expand description
Converts a number to a string using a specified base.
Required Methods
fn to_string_base(&self, base: u8) -> String
fn to_string_base(&self, base: u8) -> String
Converts a signed number to a lowercase string using a specified base.
fn to_string_base_upper(&self, base: u8) -> String
fn to_string_base_upper(&self, base: u8) -> String
Converts a signed number to an uppercase string using a specified base.
Implementations on Foreign Types
sourceimpl ToStringBase for u8
impl ToStringBase for u8
sourcefn to_string_base(&self, base: u8) -> String
fn to_string_base(&self, base: u8) -> String
Converts an unsigned number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
lowercase char
s ‘a’ to ‘z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourcefn to_string_base_upper(&self, base: u8) -> String
fn to_string_base_upper(&self, base: u8) -> String
Converts an unsigned number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
uppercase char
s ‘A’ to ‘Z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourceimpl ToStringBase for u16
impl ToStringBase for u16
sourcefn to_string_base(&self, base: u8) -> String
fn to_string_base(&self, base: u8) -> String
Converts an unsigned number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
lowercase char
s ‘a’ to ‘z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourcefn to_string_base_upper(&self, base: u8) -> String
fn to_string_base_upper(&self, base: u8) -> String
Converts an unsigned number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
uppercase char
s ‘A’ to ‘Z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourceimpl ToStringBase for u32
impl ToStringBase for u32
sourcefn to_string_base(&self, base: u8) -> String
fn to_string_base(&self, base: u8) -> String
Converts an unsigned number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
lowercase char
s ‘a’ to ‘z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourcefn to_string_base_upper(&self, base: u8) -> String
fn to_string_base_upper(&self, base: u8) -> String
Converts an unsigned number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
uppercase char
s ‘A’ to ‘Z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourceimpl ToStringBase for u64
impl ToStringBase for u64
sourcefn to_string_base(&self, base: u8) -> String
fn to_string_base(&self, base: u8) -> String
Converts an unsigned number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
lowercase char
s ‘a’ to ‘z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourcefn to_string_base_upper(&self, base: u8) -> String
fn to_string_base_upper(&self, base: u8) -> String
Converts an unsigned number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
uppercase char
s ‘A’ to ‘Z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourceimpl ToStringBase for u128
impl ToStringBase for u128
sourcefn to_string_base(&self, base: u8) -> String
fn to_string_base(&self, base: u8) -> String
Converts an unsigned number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
lowercase char
s ‘a’ to ‘z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourcefn to_string_base_upper(&self, base: u8) -> String
fn to_string_base_upper(&self, base: u8) -> String
Converts an unsigned number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
uppercase char
s ‘A’ to ‘Z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourceimpl ToStringBase for usize
impl ToStringBase for usize
sourcefn to_string_base(&self, base: u8) -> String
fn to_string_base(&self, base: u8) -> String
Converts an unsigned number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
lowercase char
s ‘a’ to ‘z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourcefn to_string_base_upper(&self, base: u8) -> String
fn to_string_base_upper(&self, base: u8) -> String
Converts an unsigned number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
uppercase char
s ‘A’ to ‘Z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourceimpl ToStringBase for i8
impl ToStringBase for i8
sourcefn to_string_base(&self, base: u8) -> String
fn to_string_base(&self, base: u8) -> String
Converts a signed number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
lowercase char
s ‘a’ to ‘z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourcefn to_string_base_upper(&self, base: u8) -> String
fn to_string_base_upper(&self, base: u8) -> String
Converts a signed number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
uppercase char
s ‘A’ to ‘Z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourceimpl ToStringBase for i16
impl ToStringBase for i16
sourcefn to_string_base(&self, base: u8) -> String
fn to_string_base(&self, base: u8) -> String
Converts a signed number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
lowercase char
s ‘a’ to ‘z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourcefn to_string_base_upper(&self, base: u8) -> String
fn to_string_base_upper(&self, base: u8) -> String
Converts a signed number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
uppercase char
s ‘A’ to ‘Z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourceimpl ToStringBase for i32
impl ToStringBase for i32
sourcefn to_string_base(&self, base: u8) -> String
fn to_string_base(&self, base: u8) -> String
Converts a signed number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
lowercase char
s ‘a’ to ‘z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourcefn to_string_base_upper(&self, base: u8) -> String
fn to_string_base_upper(&self, base: u8) -> String
Converts a signed number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
uppercase char
s ‘A’ to ‘Z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourceimpl ToStringBase for i64
impl ToStringBase for i64
sourcefn to_string_base(&self, base: u8) -> String
fn to_string_base(&self, base: u8) -> String
Converts a signed number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
lowercase char
s ‘a’ to ‘z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourcefn to_string_base_upper(&self, base: u8) -> String
fn to_string_base_upper(&self, base: u8) -> String
Converts a signed number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
uppercase char
s ‘A’ to ‘Z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourceimpl ToStringBase for i128
impl ToStringBase for i128
sourcefn to_string_base(&self, base: u8) -> String
fn to_string_base(&self, base: u8) -> String
Converts a signed number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
lowercase char
s ‘a’ to ‘z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourcefn to_string_base_upper(&self, base: u8) -> String
fn to_string_base_upper(&self, base: u8) -> String
Converts a signed number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
uppercase char
s ‘A’ to ‘Z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourceimpl ToStringBase for isize
impl ToStringBase for isize
sourcefn to_string_base(&self, base: u8) -> String
fn to_string_base(&self, base: u8) -> String
Converts a signed number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
lowercase char
s ‘a’ to ‘z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.
sourcefn to_string_base_upper(&self, base: u8) -> String
fn to_string_base_upper(&self, base: u8) -> String
Converts a signed number to a string using a specified base.
Digits from 0 to 9 become char
s from ‘0’ to ‘9’. Digits from 10 to 35 become the
uppercase char
s ‘A’ to ‘Z’.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits()
.
Panics
Panics if base
is less than 2 or greater than 36.
Examples
See here.