diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2014-11-24 20:06:06 -0500 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2014-11-25 21:24:16 -0500 |
| commit | f38e4e6d97bf1691858d007afd36b1f356de4774 (patch) | |
| tree | 8b7da6e5965cfdd680908d294bb6814b14b36298 /src/libstd/num | |
| parent | 689ef2dabfa3b2b379c953e5fb68ce2c805c2231 (diff) | |
| download | rust-f38e4e6d97bf1691858d007afd36b1f356de4774.tar.gz rust-f38e4e6d97bf1691858d007afd36b1f356de4774.zip | |
/** -> ///
This is considered good convention.
Diffstat (limited to 'src/libstd/num')
| -rw-r--r-- | src/libstd/num/strconv.rs | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs index 649298d9c08..be6e387ad83 100644 --- a/src/libstd/num/strconv.rs +++ b/src/libstd/num/strconv.rs @@ -67,31 +67,32 @@ pub enum SignFormat { SignAll, } -/** - * 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_string()` or `to_str_radix()`. - * - * # Arguments - * - `num` - The number to convert. Accepts any number that - * implements the numeric traits. - * - `radix` - Base to use. Accepts only the values 2-36. - * - `sign` - How to emit the sign. Options are: - * - `SignNone`: No sign at all. Basically emits `abs(num)`. - * - `SignNeg`: Only `-` on negative values. - * - `SignAll`: Both `+` on positive, and `-` on negative numbers. - * - `f` - a callback which will be invoked for each ascii character - * which composes the string representation of this integer - * - * # 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. - * - * # Panics - * - Panics if `radix` < 2 or `radix` > 36. - */ +/// 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_string()` or `to_str_radix()`. +/// +/// # Arguments +/// +/// - `num` - The number to convert. Accepts any number that +/// implements the numeric traits. +/// - `radix` - Base to use. Accepts only the values 2-36. +/// - `sign` - How to emit the sign. Options are: +/// - `SignNone`: No sign at all. Basically emits `abs(num)`. +/// - `SignNeg`: Only `-` on negative values. +/// - `SignAll`: Both `+` on positive, and `-` on negative numbers. +/// - `f` - a callback which will be invoked for each ascii character +/// which composes the string representation of this integer +/// +/// # 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. +/// +/// # Panics +/// +/// - Panics if `radix` < 2 or `radix` > 36. fn int_to_str_bytes_common<T: Int>(num: T, radix: uint, sign: SignFormat, f: |u8|) { assert!(2 <= radix && radix <= 36); |
