Trait malachite::num::conversion::traits::ToStringBase
source · pub trait ToStringBase {
// Required methods
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§
sourcefn 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.
sourcefn 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§
source§impl ToStringBase for i8
impl ToStringBase for i8
source§fn 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.
source§fn 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.
source§impl ToStringBase for i16
impl ToStringBase for i16
source§fn 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.
source§fn 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.
source§impl ToStringBase for i32
impl ToStringBase for i32
source§fn 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.
source§fn 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.
source§impl ToStringBase for i64
impl ToStringBase for i64
source§fn 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.
source§fn 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.
source§impl ToStringBase for i128
impl ToStringBase for i128
source§fn 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.
source§fn 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.
source§impl ToStringBase for isize
impl ToStringBase for isize
source§fn 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.
source§fn 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.
source§impl ToStringBase for u8
impl ToStringBase for u8
source§fn 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.
source§fn 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.
source§impl ToStringBase for u16
impl ToStringBase for u16
source§fn 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.
source§fn 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.
source§impl ToStringBase for u32
impl ToStringBase for u32
source§fn 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.
source§fn 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.
source§impl ToStringBase for u64
impl ToStringBase for u64
source§fn 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.
source§fn 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.
source§impl ToStringBase for u128
impl ToStringBase for u128
source§fn 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.
source§fn 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.
source§impl ToStringBase for usize
impl ToStringBase for usize
source§fn 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.
source§fn 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.