Enum ExponentFormat

Variants

Enum SignFormat

Variants

Enum SignificantDigits

Variants

Trait NumStrConv

Method NaN

fn NaN() -> Option<Self>

Method inf

fn inf() -> Option<Self>

Method neg_inf

fn neg_inf() -> Option<Self>

Method neg_zero

fn neg_zero() -> Option<Self>

Method round_to_zero

fn round_to_zero(&self) -> Self

Method fractional_part

fn fractional_part(&self) -> Self

Implementation of NumStrConv for float

Method NaN

fn NaN() -> Option<float>

Method inf

fn inf() -> Option<float>

Method neg_inf

fn neg_inf() -> Option<float>

Method neg_zero

fn neg_zero() -> Option<float>

Method round_to_zero

fn round_to_zero(&self) -> float

Method fractional_part

fn fractional_part(&self) -> float

Implementation of NumStrConv for f32

Method NaN

fn NaN() -> Option<f32>

Method inf

fn inf() -> Option<f32>

Method neg_inf

fn neg_inf() -> Option<f32>

Method neg_zero

fn neg_zero() -> Option<f32>

Method round_to_zero

fn round_to_zero(&self) -> f32

Method fractional_part

fn fractional_part(&self) -> f32

Implementation of NumStrConv for f64

Method NaN

fn NaN() -> Option<f64>

Method inf

fn inf() -> Option<f64>

Method neg_inf

fn neg_inf() -> Option<f64>

Method neg_zero

fn neg_zero() -> Option<f64>

Method round_to_zero

fn round_to_zero(&self) -> f64

Method fractional_part

fn fractional_part(&self) -> f64

Implementation of NumStrConv for int

Method NaN

fn NaN() -> Option<int>

Method inf

fn inf() -> Option<int>

Method neg_inf

fn neg_inf() -> Option<int>

Method neg_zero

fn neg_zero() -> Option<int>

Method round_to_zero

fn round_to_zero(&self) -> int

Method fractional_part

fn fractional_part(&self) -> int

Implementation of NumStrConv for i8

Method NaN

fn NaN() -> Option<i8>

Method inf

fn inf() -> Option<i8>

Method neg_inf

fn neg_inf() -> Option<i8>

Method neg_zero

fn neg_zero() -> Option<i8>

Method round_to_zero

fn round_to_zero(&self) -> i8

Method fractional_part

fn fractional_part(&self) -> i8

Implementation of NumStrConv for i16

Method NaN

fn NaN() -> Option<i16>

Method inf

fn inf() -> Option<i16>

Method neg_inf

fn neg_inf() -> Option<i16>

Method neg_zero

fn neg_zero() -> Option<i16>

Method round_to_zero

fn round_to_zero(&self) -> i16

Method fractional_part

fn fractional_part(&self) -> i16

Implementation of NumStrConv for i32

Method NaN

fn NaN() -> Option<i32>

Method inf

fn inf() -> Option<i32>

Method neg_inf

fn neg_inf() -> Option<i32>

Method neg_zero

fn neg_zero() -> Option<i32>

Method round_to_zero

fn round_to_zero(&self) -> i32

Method fractional_part

fn fractional_part(&self) -> i32

Implementation of NumStrConv for i64

Method NaN

fn NaN() -> Option<i64>

Method inf

fn inf() -> Option<i64>

Method neg_inf

fn neg_inf() -> Option<i64>

Method neg_zero

fn neg_zero() -> Option<i64>

Method round_to_zero

fn round_to_zero(&self) -> i64

Method fractional_part

fn fractional_part(&self) -> i64

Implementation of NumStrConv for uint

Method NaN

fn NaN() -> Option<uint>

Method inf

fn inf() -> Option<uint>

Method neg_inf

fn neg_inf() -> Option<uint>

Method neg_zero

fn neg_zero() -> Option<uint>

Method round_to_zero

fn round_to_zero(&self) -> uint

Method fractional_part

fn fractional_part(&self) -> uint

Implementation of NumStrConv for u8

Method NaN

fn NaN() -> Option<u8>

Method inf

fn inf() -> Option<u8>

Method neg_inf

fn neg_inf() -> Option<u8>

Method neg_zero

fn neg_zero() -> Option<u8>

Method round_to_zero

fn round_to_zero(&self) -> u8

Method fractional_part

fn fractional_part(&self) -> u8

Implementation of NumStrConv for u16

Method NaN

fn NaN() -> Option<u16>

Method inf

fn inf() -> Option<u16>

Method neg_inf

fn neg_inf() -> Option<u16>

Method neg_zero

fn neg_zero() -> Option<u16>

Method round_to_zero

fn round_to_zero(&self) -> u16

Method fractional_part

fn fractional_part(&self) -> u16

Implementation of NumStrConv for u32

Method NaN

fn NaN() -> Option<u32>

Method inf

fn inf() -> Option<u32>

Method neg_inf

fn neg_inf() -> Option<u32>

Method neg_zero

fn neg_zero() -> Option<u32>

Method round_to_zero

fn round_to_zero(&self) -> u32

Method fractional_part

fn fractional_part(&self) -> u32

Implementation of NumStrConv for u64

Method NaN

fn NaN() -> Option<u64>

Method inf

fn inf() -> Option<u64>

Method neg_inf

fn neg_inf() -> Option<u64>

Method neg_zero

fn neg_zero() -> Option<u64>

Method round_to_zero

fn round_to_zero(&self) -> u64

Method fractional_part

fn fractional_part(&self) -> u64

Function float_to_str_bytes_common

fn float_to_str_bytes_common<T: NumCast + Zero + One + Eq + Ord + Float +
                             Round + Div<T, T> + Neg<T> + Rem<T, T> +
                             Mul<T,
                                 T>>(num: T, radix: uint, negative_zero: bool,
                                     sign: SignFormat,
                                     digits: SignificantDigits) ->
 (~[u8], bool)

Converts a number to its string representation as a byte vector. This is meant to be a common base implementation for all numeric string conversion functions like to_str() or to_str_radix().

Arguments

Return value

A tuple containing the byte vector, and a boolean flag indicating whether it represents a special value like inf, -inf, NaN or not. It returns a tuple because there can be ambiguity between a special value and a number representation at higher bases.

Failure

Function float_to_str_common

fn float_to_str_common<T: NumCast + Zero + One + Eq + Ord + NumStrConv +
                       Float + Round + Div<T, T> + Neg<T> + Rem<T, T> +
                       Mul<T,
                           T>>(num: T, radix: uint, negative_zero: bool,
                               sign: SignFormat, digits: SignificantDigits) ->
 (~str, bool)

Converts a number to its string representation. This is a wrapper for to_str_bytes_common(), for details see there.

Function from_str_bytes_common

fn from_str_bytes_common<T: NumCast + Zero + One + Eq + Ord + Div<T, T> +
                         Mul<T, T> + Sub<T, T> + Neg<T> + Add<T, T> +
                         NumStrConv +
                         Clone>(buf: &[u8], radix: uint, negative: bool,
                                fractional: bool, special: bool,
                                exponent: ExponentFormat, empty_zero: bool,
                                ignore_underscores: bool) -> Option<T>

Parses a byte slice as a number. This is meant to be a common base implementation for all numeric string conversion functions like from_str() or from_str_radix().

Arguments

Return value

Returns Some(n) if buf parses to a number n without overflowing, and None otherwise, depending on the constraints set by the remaining arguments.

Failure

Function from_str_common

fn from_str_common<T: NumCast + Zero + One + Eq + Ord + Div<T, T> +
                   Mul<T, T> + Sub<T, T> + Neg<T> + Add<T, T> + NumStrConv +
                   Clone>(buf: &str, radix: uint, negative: bool,
                          fractional: bool, special: bool,
                          exponent: ExponentFormat, empty_zero: bool,
                          ignore_underscores: bool) -> Option<T>

Parses a string as a number. This is a wrapper for from_str_bytes_common(), for details see there.

Function int_to_str_bytes_common

fn int_to_str_bytes_common<T: NumCast + Zero + Eq + Ord + Integer +
                           Div<T, T> + Neg<T> + Rem<T, T> +
                           Mul<T,
                               T>>(num: T, radix: uint, sign: SignFormat,
                                   f: &fn(u8))

Converts an integral number to its string representation as a byte vector. This is meant to be a common base implementation for all integral string conversion functions like to_str() or to_str_radix().

Arguments

Return value

A tuple containing the byte vector, and a boolean flag indicating whether it represents a special value like inf, -inf, NaN or not. It returns a tuple because there can be ambiguity between a special value and a number representation at higher bases.

Failure