mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-25 06:03:16 +00:00
Remove the initial and trailing blank doc-comment lines
This commit is contained in:
parent
c13e0de836
commit
acd718b378
@ -285,20 +285,16 @@ impl Signed for f32 {
|
||||
#[inline]
|
||||
fn abs(&self) -> f32 { abs(*self) }
|
||||
|
||||
///
|
||||
/// The positive difference of two numbers. Returns `0.0` if the number is less than or
|
||||
/// equal to `other`, otherwise the difference between`self` and `other` is returned.
|
||||
///
|
||||
#[inline]
|
||||
fn abs_sub(&self, other: &f32) -> f32 { abs_sub(*self, *other) }
|
||||
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
/// - `1.0` if the number is positive, `+0.0` or `INFINITY`
|
||||
/// - `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY`
|
||||
/// - `NAN` if the number is NaN
|
||||
///
|
||||
#[inline]
|
||||
fn signum(&self) -> f32 {
|
||||
if self.is_nan() { NAN } else { copysign(1.0, *self) }
|
||||
@ -330,14 +326,12 @@ impl Round for f32 {
|
||||
#[inline]
|
||||
fn trunc(&self) -> f32 { trunc(*self) }
|
||||
|
||||
///
|
||||
/// The fractional part of the number, satisfying:
|
||||
///
|
||||
/// ```rust
|
||||
/// let x = 1.65f32;
|
||||
/// assert!(x == x.trunc() + x.fract())
|
||||
/// ```
|
||||
///
|
||||
#[inline]
|
||||
fn fract(&self) -> f32 { *self - self.trunc() }
|
||||
}
|
||||
@ -490,7 +484,6 @@ impl Real for f32 {
|
||||
#[inline]
|
||||
fn tanh(&self) -> f32 { tanh(*self) }
|
||||
|
||||
///
|
||||
/// Inverse hyperbolic sine
|
||||
///
|
||||
/// # Returns
|
||||
@ -498,7 +491,6 @@ impl Real for f32 {
|
||||
/// - on success, the inverse hyperbolic sine of `self` will be returned
|
||||
/// - `self` if `self` is `0.0`, `-0.0`, `INFINITY`, or `NEG_INFINITY`
|
||||
/// - `NAN` if `self` is `NAN`
|
||||
///
|
||||
#[inline]
|
||||
fn asinh(&self) -> f32 {
|
||||
match *self {
|
||||
@ -507,7 +499,6 @@ impl Real for f32 {
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Inverse hyperbolic cosine
|
||||
///
|
||||
/// # Returns
|
||||
@ -515,7 +506,6 @@ impl Real for f32 {
|
||||
/// - on success, the inverse hyperbolic cosine of `self` will be returned
|
||||
/// - `INFINITY` if `self` is `INFINITY`
|
||||
/// - `NAN` if `self` is `NAN` or `self < 1.0` (including `NEG_INFINITY`)
|
||||
///
|
||||
#[inline]
|
||||
fn acosh(&self) -> f32 {
|
||||
match *self {
|
||||
@ -524,7 +514,6 @@ impl Real for f32 {
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Inverse hyperbolic tangent
|
||||
///
|
||||
/// # Returns
|
||||
@ -535,7 +524,6 @@ impl Real for f32 {
|
||||
/// - `NEG_INFINITY` if `self` is `-1.0`
|
||||
/// - `NAN` if the `self` is `NAN` or outside the domain of `-1.0 <= self <= 1.0`
|
||||
/// (including `INFINITY` and `NEG_INFINITY`)
|
||||
///
|
||||
#[inline]
|
||||
fn atanh(&self) -> f32 {
|
||||
0.5 * ((2.0 * *self) / (1.0 - *self)).ln_1p()
|
||||
@ -643,12 +631,10 @@ impl Float for f32 {
|
||||
ldexp(x, exp as c_int)
|
||||
}
|
||||
|
||||
///
|
||||
/// Breaks the number into a normalized fraction and a base-2 exponent, satisfying:
|
||||
///
|
||||
/// - `self = x * pow(2, exp)`
|
||||
/// - `0.5 <= abs(x) < 1.0`
|
||||
///
|
||||
#[inline]
|
||||
fn frexp(&self) -> (f32, int) {
|
||||
let mut exp = 0;
|
||||
@ -656,25 +642,19 @@ impl Float for f32 {
|
||||
(x, exp as int)
|
||||
}
|
||||
|
||||
///
|
||||
/// Returns the exponential of the number, minus `1`, in a way that is accurate
|
||||
/// even if the number is close to zero
|
||||
///
|
||||
#[inline]
|
||||
fn exp_m1(&self) -> f32 { exp_m1(*self) }
|
||||
|
||||
///
|
||||
/// Returns the natural logarithm of the number plus `1` (`ln(1+n)`) more accurately
|
||||
/// than if the operations were performed separately
|
||||
///
|
||||
#[inline]
|
||||
fn ln_1p(&self) -> f32 { ln_1p(*self) }
|
||||
|
||||
///
|
||||
/// Fused multiply-add. Computes `(self * a) + b` with only one rounding error. This
|
||||
/// produces a more accurate result with better performance than a separate multiplication
|
||||
/// operation followed by an add.
|
||||
///
|
||||
#[inline]
|
||||
fn mul_add(&self, a: f32, b: f32) -> f32 {
|
||||
mul_add(*self, a, b)
|
||||
@ -708,13 +688,11 @@ impl Float for f32 {
|
||||
// Section: String Conversions
|
||||
//
|
||||
|
||||
///
|
||||
/// Converts a float to a string
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * num - The float value
|
||||
///
|
||||
#[inline]
|
||||
pub fn to_str(num: f32) -> ~str {
|
||||
let (r, _) = strconv::float_to_str_common(
|
||||
@ -722,13 +700,11 @@ pub fn to_str(num: f32) -> ~str {
|
||||
r
|
||||
}
|
||||
|
||||
///
|
||||
/// Converts a float to a string in hexadecimal format
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * num - The float value
|
||||
///
|
||||
#[inline]
|
||||
pub fn to_str_hex(num: f32) -> ~str {
|
||||
let (r, _) = strconv::float_to_str_common(
|
||||
@ -736,7 +712,6 @@ pub fn to_str_hex(num: f32) -> ~str {
|
||||
r
|
||||
}
|
||||
|
||||
///
|
||||
/// Converts a float to a string in a given radix, and a flag indicating
|
||||
/// whether it's a special value
|
||||
///
|
||||
@ -744,14 +719,12 @@ pub fn to_str_hex(num: f32) -> ~str {
|
||||
///
|
||||
/// * num - The float value
|
||||
/// * radix - The base to use
|
||||
///
|
||||
#[inline]
|
||||
pub fn to_str_radix_special(num: f32, rdx: uint) -> (~str, bool) {
|
||||
strconv::float_to_str_common(num, rdx, true,
|
||||
strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false)
|
||||
}
|
||||
|
||||
///
|
||||
/// Converts a float to a string with exactly the number of
|
||||
/// provided significant digits
|
||||
///
|
||||
@ -759,7 +732,6 @@ pub fn to_str_radix_special(num: f32, rdx: uint) -> (~str, bool) {
|
||||
///
|
||||
/// * num - The float value
|
||||
/// * digits - The number of significant digits
|
||||
///
|
||||
#[inline]
|
||||
pub fn to_str_exact(num: f32, dig: uint) -> ~str {
|
||||
let (r, _) = strconv::float_to_str_common(
|
||||
@ -767,7 +739,6 @@ pub fn to_str_exact(num: f32, dig: uint) -> ~str {
|
||||
r
|
||||
}
|
||||
|
||||
///
|
||||
/// Converts a float to a string with a maximum number of
|
||||
/// significant digits
|
||||
///
|
||||
@ -775,7 +746,6 @@ pub fn to_str_exact(num: f32, dig: uint) -> ~str {
|
||||
///
|
||||
/// * num - The float value
|
||||
/// * digits - The number of significant digits
|
||||
///
|
||||
#[inline]
|
||||
pub fn to_str_digits(num: f32, dig: uint) -> ~str {
|
||||
let (r, _) = strconv::float_to_str_common(
|
||||
@ -783,7 +753,6 @@ pub fn to_str_digits(num: f32, dig: uint) -> ~str {
|
||||
r
|
||||
}
|
||||
|
||||
///
|
||||
/// Converts a float to a string using the exponential notation with exactly the number of
|
||||
/// provided digits after the decimal point in the significand
|
||||
///
|
||||
@ -792,7 +761,6 @@ pub fn to_str_digits(num: f32, dig: uint) -> ~str {
|
||||
/// * num - The float value
|
||||
/// * digits - The number of digits after the decimal point
|
||||
/// * upper - Use `E` instead of `e` for the exponent sign
|
||||
///
|
||||
#[inline]
|
||||
pub fn to_str_exp_exact(num: f32, dig: uint, upper: bool) -> ~str {
|
||||
let (r, _) = strconv::float_to_str_common(
|
||||
@ -800,7 +768,6 @@ pub fn to_str_exp_exact(num: f32, dig: uint, upper: bool) -> ~str {
|
||||
r
|
||||
}
|
||||
|
||||
///
|
||||
/// Converts a float to a string using the exponential notation with the maximum number of
|
||||
/// digits after the decimal point in the significand
|
||||
///
|
||||
@ -809,7 +776,6 @@ pub fn to_str_exp_exact(num: f32, dig: uint, upper: bool) -> ~str {
|
||||
/// * num - The float value
|
||||
/// * digits - The number of digits after the decimal point
|
||||
/// * upper - Use `E` instead of `e` for the exponent sign
|
||||
///
|
||||
#[inline]
|
||||
pub fn to_str_exp_digits(num: f32, dig: uint, upper: bool) -> ~str {
|
||||
let (r, _) = strconv::float_to_str_common(
|
||||
@ -845,7 +811,6 @@ impl num::ToStrRadix for f32 {
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Convert a string in base 16 to a float.
|
||||
/// Accepts a optional binary exponent.
|
||||
///
|
||||
@ -871,7 +836,6 @@ impl num::ToStrRadix for f32 {
|
||||
///
|
||||
/// `None` if the string did not represent a valid number. Otherwise,
|
||||
/// `Some(n)` where `n` is the floating-point number represented by `[num]`.
|
||||
///
|
||||
#[inline]
|
||||
pub fn from_str_hex(num: &str) -> Option<f32> {
|
||||
strconv::from_str_common(num, 16u, true, true, true,
|
||||
@ -879,7 +843,6 @@ pub fn from_str_hex(num: &str) -> Option<f32> {
|
||||
}
|
||||
|
||||
impl FromStr for f32 {
|
||||
///
|
||||
/// Convert a string in base 10 to a float.
|
||||
/// Accepts a optional decimal exponent.
|
||||
///
|
||||
@ -905,7 +868,6 @@ impl FromStr for f32 {
|
||||
///
|
||||
/// `None` if the string did not represent a valid number. Otherwise,
|
||||
/// `Some(n)` where `n` is the floating-point number represented by `num`.
|
||||
///
|
||||
#[inline]
|
||||
fn from_str(val: &str) -> Option<f32> {
|
||||
strconv::from_str_common(val, 10u, true, true, true,
|
||||
@ -914,7 +876,6 @@ impl FromStr for f32 {
|
||||
}
|
||||
|
||||
impl num::FromStrRadix for f32 {
|
||||
///
|
||||
/// Convert a string in an given base to a float.
|
||||
///
|
||||
/// Due to possible conflicts, this function does **not** accept
|
||||
@ -932,7 +893,6 @@ impl num::FromStrRadix for f32 {
|
||||
///
|
||||
/// `None` if the string did not represent a valid number. Otherwise,
|
||||
/// `Some(n)` where `n` is the floating-point number represented by `num`.
|
||||
///
|
||||
#[inline]
|
||||
fn from_str_radix(val: &str, rdx: uint) -> Option<f32> {
|
||||
strconv::from_str_common(val, rdx, true, true, false,
|
||||
|
@ -287,20 +287,16 @@ impl Signed for f64 {
|
||||
#[inline]
|
||||
fn abs(&self) -> f64 { abs(*self) }
|
||||
|
||||
///
|
||||
/// The positive difference of two numbers. Returns `0.0` if the number is less than or
|
||||
/// equal to `other`, otherwise the difference between`self` and `other` is returned.
|
||||
///
|
||||
#[inline]
|
||||
fn abs_sub(&self, other: &f64) -> f64 { abs_sub(*self, *other) }
|
||||
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
/// - `1.0` if the number is positive, `+0.0` or `INFINITY`
|
||||
/// - `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY`
|
||||
/// - `NAN` if the number is NaN
|
||||
///
|
||||
#[inline]
|
||||
fn signum(&self) -> f64 {
|
||||
if self.is_nan() { NAN } else { copysign(1.0, *self) }
|
||||
@ -332,14 +328,12 @@ impl Round for f64 {
|
||||
#[inline]
|
||||
fn trunc(&self) -> f64 { trunc(*self) }
|
||||
|
||||
///
|
||||
/// The fractional part of the number, satisfying:
|
||||
///
|
||||
/// ```rust
|
||||
/// let x = 1.65f64;
|
||||
/// assert!(x == x.trunc() + x.fract())
|
||||
/// ```
|
||||
///
|
||||
#[inline]
|
||||
fn fract(&self) -> f64 { *self - self.trunc() }
|
||||
}
|
||||
@ -492,7 +486,6 @@ impl Real for f64 {
|
||||
#[inline]
|
||||
fn tanh(&self) -> f64 { tanh(*self) }
|
||||
|
||||
///
|
||||
/// Inverse hyperbolic sine
|
||||
///
|
||||
/// # Returns
|
||||
@ -500,7 +493,6 @@ impl Real for f64 {
|
||||
/// - on success, the inverse hyperbolic sine of `self` will be returned
|
||||
/// - `self` if `self` is `0.0`, `-0.0`, `INFINITY`, or `NEG_INFINITY`
|
||||
/// - `NAN` if `self` is `NAN`
|
||||
///
|
||||
#[inline]
|
||||
fn asinh(&self) -> f64 {
|
||||
match *self {
|
||||
@ -509,7 +501,6 @@ impl Real for f64 {
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Inverse hyperbolic cosine
|
||||
///
|
||||
/// # Returns
|
||||
@ -517,7 +508,6 @@ impl Real for f64 {
|
||||
/// - on success, the inverse hyperbolic cosine of `self` will be returned
|
||||
/// - `INFINITY` if `self` is `INFINITY`
|
||||
/// - `NAN` if `self` is `NAN` or `self < 1.0` (including `NEG_INFINITY`)
|
||||
///
|
||||
#[inline]
|
||||
fn acosh(&self) -> f64 {
|
||||
match *self {
|
||||
@ -526,7 +516,6 @@ impl Real for f64 {
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Inverse hyperbolic tangent
|
||||
///
|
||||
/// # Returns
|
||||
@ -537,7 +526,6 @@ impl Real for f64 {
|
||||
/// - `NEG_INFINITY` if `self` is `-1.0`
|
||||
/// - `NAN` if the `self` is `NAN` or outside the domain of `-1.0 <= self <= 1.0`
|
||||
/// (including `INFINITY` and `NEG_INFINITY`)
|
||||
///
|
||||
#[inline]
|
||||
fn atanh(&self) -> f64 {
|
||||
0.5 * ((2.0 * *self) / (1.0 - *self)).ln_1p()
|
||||
@ -645,12 +633,10 @@ impl Float for f64 {
|
||||
ldexp(x, exp as c_int)
|
||||
}
|
||||
|
||||
///
|
||||
/// Breaks the number into a normalized fraction and a base-2 exponent, satisfying:
|
||||
///
|
||||
/// - `self = x * pow(2, exp)`
|
||||
/// - `0.5 <= abs(x) < 1.0`
|
||||
///
|
||||
#[inline]
|
||||
fn frexp(&self) -> (f64, int) {
|
||||
let mut exp = 0;
|
||||
@ -658,25 +644,19 @@ impl Float for f64 {
|
||||
(x, exp as int)
|
||||
}
|
||||
|
||||
///
|
||||
/// Returns the exponential of the number, minus `1`, in a way that is accurate
|
||||
/// even if the number is close to zero
|
||||
///
|
||||
#[inline]
|
||||
fn exp_m1(&self) -> f64 { exp_m1(*self) }
|
||||
|
||||
///
|
||||
/// Returns the natural logarithm of the number plus `1` (`ln(1+n)`) more accurately
|
||||
/// than if the operations were performed separately
|
||||
///
|
||||
#[inline]
|
||||
fn ln_1p(&self) -> f64 { ln_1p(*self) }
|
||||
|
||||
///
|
||||
/// Fused multiply-add. Computes `(self * a) + b` with only one rounding error. This
|
||||
/// produces a more accurate result with better performance than a separate multiplication
|
||||
/// operation followed by an add.
|
||||
///
|
||||
#[inline]
|
||||
fn mul_add(&self, a: f64, b: f64) -> f64 {
|
||||
mul_add(*self, a, b)
|
||||
@ -710,13 +690,11 @@ impl Float for f64 {
|
||||
// Section: String Conversions
|
||||
//
|
||||
|
||||
///
|
||||
/// Converts a float to a string
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * num - The float value
|
||||
///
|
||||
#[inline]
|
||||
pub fn to_str(num: f64) -> ~str {
|
||||
let (r, _) = strconv::float_to_str_common(
|
||||
@ -724,13 +702,11 @@ pub fn to_str(num: f64) -> ~str {
|
||||
r
|
||||
}
|
||||
|
||||
///
|
||||
/// Converts a float to a string in hexadecimal format
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * num - The float value
|
||||
///
|
||||
#[inline]
|
||||
pub fn to_str_hex(num: f64) -> ~str {
|
||||
let (r, _) = strconv::float_to_str_common(
|
||||
@ -738,7 +714,6 @@ pub fn to_str_hex(num: f64) -> ~str {
|
||||
r
|
||||
}
|
||||
|
||||
///
|
||||
/// Converts a float to a string in a given radix, and a flag indicating
|
||||
/// whether it's a special value
|
||||
///
|
||||
@ -746,14 +721,12 @@ pub fn to_str_hex(num: f64) -> ~str {
|
||||
///
|
||||
/// * num - The float value
|
||||
/// * radix - The base to use
|
||||
///
|
||||
#[inline]
|
||||
pub fn to_str_radix_special(num: f64, rdx: uint) -> (~str, bool) {
|
||||
strconv::float_to_str_common(num, rdx, true,
|
||||
strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false)
|
||||
}
|
||||
|
||||
///
|
||||
/// Converts a float to a string with exactly the number of
|
||||
/// provided significant digits
|
||||
///
|
||||
@ -761,7 +734,6 @@ pub fn to_str_radix_special(num: f64, rdx: uint) -> (~str, bool) {
|
||||
///
|
||||
/// * num - The float value
|
||||
/// * digits - The number of significant digits
|
||||
///
|
||||
#[inline]
|
||||
pub fn to_str_exact(num: f64, dig: uint) -> ~str {
|
||||
let (r, _) = strconv::float_to_str_common(
|
||||
@ -769,7 +741,6 @@ pub fn to_str_exact(num: f64, dig: uint) -> ~str {
|
||||
r
|
||||
}
|
||||
|
||||
///
|
||||
/// Converts a float to a string with a maximum number of
|
||||
/// significant digits
|
||||
///
|
||||
@ -777,7 +748,6 @@ pub fn to_str_exact(num: f64, dig: uint) -> ~str {
|
||||
///
|
||||
/// * num - The float value
|
||||
/// * digits - The number of significant digits
|
||||
///
|
||||
#[inline]
|
||||
pub fn to_str_digits(num: f64, dig: uint) -> ~str {
|
||||
let (r, _) = strconv::float_to_str_common(
|
||||
@ -785,7 +755,6 @@ pub fn to_str_digits(num: f64, dig: uint) -> ~str {
|
||||
r
|
||||
}
|
||||
|
||||
///
|
||||
/// Converts a float to a string using the exponential notation with exactly the number of
|
||||
/// provided digits after the decimal point in the significand
|
||||
///
|
||||
@ -794,7 +763,6 @@ pub fn to_str_digits(num: f64, dig: uint) -> ~str {
|
||||
/// * num - The float value
|
||||
/// * digits - The number of digits after the decimal point
|
||||
/// * upper - Use `E` instead of `e` for the exponent sign
|
||||
///
|
||||
#[inline]
|
||||
pub fn to_str_exp_exact(num: f64, dig: uint, upper: bool) -> ~str {
|
||||
let (r, _) = strconv::float_to_str_common(
|
||||
@ -802,7 +770,6 @@ pub fn to_str_exp_exact(num: f64, dig: uint, upper: bool) -> ~str {
|
||||
r
|
||||
}
|
||||
|
||||
///
|
||||
/// Converts a float to a string using the exponential notation with the maximum number of
|
||||
/// digits after the decimal point in the significand
|
||||
///
|
||||
@ -811,7 +778,6 @@ pub fn to_str_exp_exact(num: f64, dig: uint, upper: bool) -> ~str {
|
||||
/// * num - The float value
|
||||
/// * digits - The number of digits after the decimal point
|
||||
/// * upper - Use `E` instead of `e` for the exponent sign
|
||||
///
|
||||
#[inline]
|
||||
pub fn to_str_exp_digits(num: f64, dig: uint, upper: bool) -> ~str {
|
||||
let (r, _) = strconv::float_to_str_common(
|
||||
@ -847,7 +813,6 @@ impl num::ToStrRadix for f64 {
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Convert a string in base 16 to a float.
|
||||
/// Accepts a optional binary exponent.
|
||||
///
|
||||
@ -873,7 +838,6 @@ impl num::ToStrRadix for f64 {
|
||||
///
|
||||
/// `None` if the string did not represent a valid number. Otherwise,
|
||||
/// `Some(n)` where `n` is the floating-point number represented by `[num]`.
|
||||
///
|
||||
#[inline]
|
||||
pub fn from_str_hex(num: &str) -> Option<f64> {
|
||||
strconv::from_str_common(num, 16u, true, true, true,
|
||||
@ -881,7 +845,6 @@ pub fn from_str_hex(num: &str) -> Option<f64> {
|
||||
}
|
||||
|
||||
impl FromStr for f64 {
|
||||
///
|
||||
/// Convert a string in base 10 to a float.
|
||||
/// Accepts a optional decimal exponent.
|
||||
///
|
||||
@ -907,7 +870,6 @@ impl FromStr for f64 {
|
||||
///
|
||||
/// `none` if the string did not represent a valid number. Otherwise,
|
||||
/// `Some(n)` where `n` is the floating-point number represented by `num`.
|
||||
///
|
||||
#[inline]
|
||||
fn from_str(val: &str) -> Option<f64> {
|
||||
strconv::from_str_common(val, 10u, true, true, true,
|
||||
@ -916,7 +878,6 @@ impl FromStr for f64 {
|
||||
}
|
||||
|
||||
impl num::FromStrRadix for f64 {
|
||||
///
|
||||
/// Convert a string in an given base to a float.
|
||||
///
|
||||
/// Due to possible conflicts, this function does **not** accept
|
||||
@ -934,7 +895,6 @@ impl num::FromStrRadix for f64 {
|
||||
///
|
||||
/// `None` if the string did not represent a valid number. Otherwise,
|
||||
/// `Some(n)` where `n` is the floating-point number represented by `num`.
|
||||
///
|
||||
#[inline]
|
||||
fn from_str_radix(val: &str, rdx: uint) -> Option<f64> {
|
||||
strconv::from_str_common(val, rdx, true, true, false,
|
||||
|
Loading…
Reference in New Issue
Block a user