Skip to content

Commit

Permalink
Remove the initial and trailing blank doc-comment lines
Browse files Browse the repository at this point in the history
  • Loading branch information
SiegeLord committed Jan 23, 2014
1 parent c13e0de commit acd718b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 80 deletions.
40 changes: 0 additions & 40 deletions src/libstd/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down Expand Up @@ -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() }
}
Expand Down Expand Up @@ -490,15 +484,13 @@ impl Real for f32 {
#[inline]
fn tanh(&self) -> f32 { tanh(*self) }

///
/// Inverse hyperbolic sine
///
/// # Returns
///
/// - 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 {
Expand All @@ -507,15 +499,13 @@ impl Real for f32 {
}
}

///
/// Inverse hyperbolic cosine
///
/// # Returns
///
/// - 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 {
Expand All @@ -524,7 +514,6 @@ impl Real for f32 {
}
}

///
/// Inverse hyperbolic tangent
///
/// # Returns
Expand All @@ -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()
Expand Down Expand Up @@ -643,38 +631,30 @@ 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;
let x = frexp(*self, &mut exp);
(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)
Expand Down Expand Up @@ -708,82 +688,71 @@ 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(
num, 10u, true, strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false);
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(
num, 16u, true, strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false);
r
}

///
/// Converts a float to a string in a given radix, and a flag indicating
/// whether it's a special value
///
/// # Arguments
///
/// * 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
///
/// # Arguments
///
/// * 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(
num, 10u, true, strconv::SignNeg, strconv::DigExact(dig), strconv::ExpNone, false);
r
}

///
/// Converts a float to a string with a maximum number of
/// significant digits
///
/// # Arguments
///
/// * 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(
num, 10u, true, strconv::SignNeg, strconv::DigMax(dig), strconv::ExpNone, false);
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
///
Expand All @@ -792,15 +761,13 @@ 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(
num, 10u, true, strconv::SignNeg, strconv::DigExact(dig), strconv::ExpDec, upper);
r
}

///
/// Converts a float to a string using the exponential notation with the maximum number of
/// digits after the decimal point in the significand
///
Expand All @@ -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(
Expand Down Expand Up @@ -845,7 +811,6 @@ impl num::ToStrRadix for f32 {
}
}

///
/// Convert a string in base 16 to a float.
/// Accepts a optional binary exponent.
///
Expand All @@ -871,15 +836,13 @@ 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,
strconv::ExpBin, false, false)
}

impl FromStr for f32 {
///
/// Convert a string in base 10 to a float.
/// Accepts a optional decimal exponent.
///
Expand All @@ -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,
Expand All @@ -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
Expand All @@ -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,
Expand Down
Loading

5 comments on commit acd718b

@bors
Copy link
Contributor

@bors bors commented on acd718b Jan 23, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at SiegeLord@acd718b

@bors
Copy link
Contributor

@bors bors commented on acd718b Jan 23, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging SiegeLord/rust/exp_printing = acd718b into auto

@bors
Copy link
Contributor

@bors bors commented on acd718b Jan 23, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SiegeLord/rust/exp_printing = acd718b merged ok, testing candidate = 52ba3b6

@bors
Copy link
Contributor

@bors bors commented on acd718b Jan 23, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on acd718b Jan 23, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 52ba3b6

Please sign in to comment.