Trait malachite_base::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§

source

fn to_string_base(&self, base: u8) -> String

Converts a signed number to a lowercase string using a specified base.

source

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

source§

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 chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘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

Converts a signed number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘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

source§

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 chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘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

Converts a signed number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘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

source§

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 chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘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

Converts a signed number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘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

source§

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 chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘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

Converts a signed number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘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

source§

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 chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘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

Converts a signed number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘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

source§

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 chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘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

Converts a signed number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘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

source§

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 chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘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

Converts an unsigned number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘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

source§

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 chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘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

Converts an unsigned number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘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

source§

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 chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘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

Converts an unsigned number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘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

source§

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 chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘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

Converts an unsigned number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘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

source§

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 chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘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

Converts an unsigned number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘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

source§

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 chars from ‘0’ to ‘9’. Digits from 10 to 35 become the lowercase chars ‘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

Converts an unsigned number to a string using a specified base.

Digits from 0 to 9 become chars from ‘0’ to ‘9’. Digits from 10 to 35 become the uppercase chars ‘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.

Implementors§