Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit acd718b

Browse files
committedJan 23, 2014
Remove the initial and trailing blank doc-comment lines
1 parent c13e0de commit acd718b

File tree

2 files changed

+0
-80
lines changed

2 files changed

+0
-80
lines changed
 

‎src/libstd/num/f32.rs‎

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -285,20 +285,16 @@ impl Signed for f32 {
285285
#[inline]
286286
fn abs(&self) -> f32 { abs(*self) }
287287

288-
///
289288
/// The positive difference of two numbers. Returns `0.0` if the number is less than or
290289
/// equal to `other`, otherwise the difference between`self` and `other` is returned.
291-
///
292290
#[inline]
293291
fn abs_sub(&self, other: &f32) -> f32 { abs_sub(*self, *other) }
294292

295-
///
296293
/// # Returns
297294
///
298295
/// - `1.0` if the number is positive, `+0.0` or `INFINITY`
299296
/// - `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY`
300297
/// - `NAN` if the number is NaN
301-
///
302298
#[inline]
303299
fn signum(&self) -> f32 {
304300
if self.is_nan() { NAN } else { copysign(1.0, *self) }
@@ -330,14 +326,12 @@ impl Round for f32 {
330326
#[inline]
331327
fn trunc(&self) -> f32 { trunc(*self) }
332328

333-
///
334329
/// The fractional part of the number, satisfying:
335330
///
336331
/// ```rust
337332
/// let x = 1.65f32;
338333
/// assert!(x == x.trunc() + x.fract())
339334
/// ```
340-
///
341335
#[inline]
342336
fn fract(&self) -> f32 { *self - self.trunc() }
343337
}
@@ -490,15 +484,13 @@ impl Real for f32 {
490484
#[inline]
491485
fn tanh(&self) -> f32 { tanh(*self) }
492486

493-
///
494487
/// Inverse hyperbolic sine
495488
///
496489
/// # Returns
497490
///
498491
/// - on success, the inverse hyperbolic sine of `self` will be returned
499492
/// - `self` if `self` is `0.0`, `-0.0`, `INFINITY`, or `NEG_INFINITY`
500493
/// - `NAN` if `self` is `NAN`
501-
///
502494
#[inline]
503495
fn asinh(&self) -> f32 {
504496
match *self {
@@ -507,15 +499,13 @@ impl Real for f32 {
507499
}
508500
}
509501

510-
///
511502
/// Inverse hyperbolic cosine
512503
///
513504
/// # Returns
514505
///
515506
/// - on success, the inverse hyperbolic cosine of `self` will be returned
516507
/// - `INFINITY` if `self` is `INFINITY`
517508
/// - `NAN` if `self` is `NAN` or `self < 1.0` (including `NEG_INFINITY`)
518-
///
519509
#[inline]
520510
fn acosh(&self) -> f32 {
521511
match *self {
@@ -524,7 +514,6 @@ impl Real for f32 {
524514
}
525515
}
526516

527-
///
528517
/// Inverse hyperbolic tangent
529518
///
530519
/// # Returns
@@ -535,7 +524,6 @@ impl Real for f32 {
535524
/// - `NEG_INFINITY` if `self` is `-1.0`
536525
/// - `NAN` if the `self` is `NAN` or outside the domain of `-1.0 <= self <= 1.0`
537526
/// (including `INFINITY` and `NEG_INFINITY`)
538-
///
539527
#[inline]
540528
fn atanh(&self) -> f32 {
541529
0.5 * ((2.0 * *self) / (1.0 - *self)).ln_1p()
@@ -643,38 +631,30 @@ impl Float for f32 {
643631
ldexp(x, exp as c_int)
644632
}
645633

646-
///
647634
/// Breaks the number into a normalized fraction and a base-2 exponent, satisfying:
648635
///
649636
/// - `self = x * pow(2, exp)`
650637
/// - `0.5 <= abs(x) < 1.0`
651-
///
652638
#[inline]
653639
fn frexp(&self) -> (f32, int) {
654640
let mut exp = 0;
655641
let x = frexp(*self, &mut exp);
656642
(x, exp as int)
657643
}
658644

659-
///
660645
/// Returns the exponential of the number, minus `1`, in a way that is accurate
661646
/// even if the number is close to zero
662-
///
663647
#[inline]
664648
fn exp_m1(&self) -> f32 { exp_m1(*self) }
665649

666-
///
667650
/// Returns the natural logarithm of the number plus `1` (`ln(1+n)`) more accurately
668651
/// than if the operations were performed separately
669-
///
670652
#[inline]
671653
fn ln_1p(&self) -> f32 { ln_1p(*self) }
672654

673-
///
674655
/// Fused multiply-add. Computes `(self * a) + b` with only one rounding error. This
675656
/// produces a more accurate result with better performance than a separate multiplication
676657
/// operation followed by an add.
677-
///
678658
#[inline]
679659
fn mul_add(&self, a: f32, b: f32) -> f32 {
680660
mul_add(*self, a, b)
@@ -708,82 +688,71 @@ impl Float for f32 {
708688
// Section: String Conversions
709689
//
710690

711-
///
712691
/// Converts a float to a string
713692
///
714693
/// # Arguments
715694
///
716695
/// * num - The float value
717-
///
718696
#[inline]
719697
pub fn to_str(num: f32) -> ~str {
720698
let (r, _) = strconv::float_to_str_common(
721699
num, 10u, true, strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false);
722700
r
723701
}
724702

725-
///
726703
/// Converts a float to a string in hexadecimal format
727704
///
728705
/// # Arguments
729706
///
730707
/// * num - The float value
731-
///
732708
#[inline]
733709
pub fn to_str_hex(num: f32) -> ~str {
734710
let (r, _) = strconv::float_to_str_common(
735711
num, 16u, true, strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false);
736712
r
737713
}
738714

739-
///
740715
/// Converts a float to a string in a given radix, and a flag indicating
741716
/// whether it's a special value
742717
///
743718
/// # Arguments
744719
///
745720
/// * num - The float value
746721
/// * radix - The base to use
747-
///
748722
#[inline]
749723
pub fn to_str_radix_special(num: f32, rdx: uint) -> (~str, bool) {
750724
strconv::float_to_str_common(num, rdx, true,
751725
strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false)
752726
}
753727

754-
///
755728
/// Converts a float to a string with exactly the number of
756729
/// provided significant digits
757730
///
758731
/// # Arguments
759732
///
760733
/// * num - The float value
761734
/// * digits - The number of significant digits
762-
///
763735
#[inline]
764736
pub fn to_str_exact(num: f32, dig: uint) -> ~str {
765737
let (r, _) = strconv::float_to_str_common(
766738
num, 10u, true, strconv::SignNeg, strconv::DigExact(dig), strconv::ExpNone, false);
767739
r
768740
}
769741

770-
///
771742
/// Converts a float to a string with a maximum number of
772743
/// significant digits
773744
///
774745
/// # Arguments
775746
///
776747
/// * num - The float value
777748
/// * digits - The number of significant digits
778-
///
779749
#[inline]
780750
pub fn to_str_digits(num: f32, dig: uint) -> ~str {
781751
let (r, _) = strconv::float_to_str_common(
782752
num, 10u, true, strconv::SignNeg, strconv::DigMax(dig), strconv::ExpNone, false);
783753
r
784754
}
785755

786-
///
787756
/// Converts a float to a string using the exponential notation with exactly the number of
788757
/// provided digits after the decimal point in the significand
789758
///
@@ -792,15 +761,13 @@ pub fn to_str_digits(num: f32, dig: uint) -> ~str {
792761
/// * num - The float value
793762
/// * digits - The number of digits after the decimal point
794763
/// * upper - Use `E` instead of `e` for the exponent sign
795-
///
796764
#[inline]
797765
pub fn to_str_exp_exact(num: f32, dig: uint, upper: bool) -> ~str {
798766
let (r, _) = strconv::float_to_str_common(
799767
num, 10u, true, strconv::SignNeg, strconv::DigExact(dig), strconv::ExpDec, upper);
800768
r
801769
}
802770

803-
///
804771
/// Converts a float to a string using the exponential notation with the maximum number of
805772
/// digits after the decimal point in the significand
806773
///
@@ -809,7 +776,6 @@ pub fn to_str_exp_exact(num: f32, dig: uint, upper: bool) -> ~str {
809776
/// * num - The float value
810777
/// * digits - The number of digits after the decimal point
811778
/// * upper - Use `E` instead of `e` for the exponent sign
812-
///
813779
#[inline]
814780
pub fn to_str_exp_digits(num: f32, dig: uint, upper: bool) -> ~str {
815781
let (r, _) = strconv::float_to_str_common(
@@ -845,7 +811,6 @@ impl num::ToStrRadix for f32 {
845811
}
846812
}
847813

848-
///
849814
/// Convert a string in base 16 to a float.
850815
/// Accepts a optional binary exponent.
851816
///
@@ -871,15 +836,13 @@ impl num::ToStrRadix for f32 {
871836
///
872837
/// `None` if the string did not represent a valid number. Otherwise,
873838
/// `Some(n)` where `n` is the floating-point number represented by `[num]`.
874-
///
875839
#[inline]
876840
pub fn from_str_hex(num: &str) -> Option<f32> {
877841
strconv::from_str_common(num, 16u, true, true, true,
878842
strconv::ExpBin, false, false)
879843
}
880844

881845
impl FromStr for f32 {
882-
///
883846
/// Convert a string in base 10 to a float.
884847
/// Accepts a optional decimal exponent.
885848
///
@@ -905,7 +868,6 @@ impl FromStr for f32 {
905868
///
906869
/// `None` if the string did not represent a valid number. Otherwise,
907870
/// `Some(n)` where `n` is the floating-point number represented by `num`.
908-
///
909871
#[inline]
910872
fn from_str(val: &str) -> Option<f32> {
911873
strconv::from_str_common(val, 10u, true, true, true,
@@ -914,7 +876,6 @@ impl FromStr for f32 {
914876
}
915877

916878
impl num::FromStrRadix for f32 {
917-
///
918879
/// Convert a string in an given base to a float.
919880
///
920881
/// Due to possible conflicts, this function does **not** accept
@@ -932,7 +893,6 @@ impl num::FromStrRadix for f32 {
932893
///
933894
/// `None` if the string did not represent a valid number. Otherwise,
934895
/// `Some(n)` where `n` is the floating-point number represented by `num`.
935-
///
936896
#[inline]
937897
fn from_str_radix(val: &str, rdx: uint) -> Option<f32> {
938898
strconv::from_str_common(val, rdx, true, true, false,

‎src/libstd/num/f64.rs‎

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -287,20 +287,16 @@ impl Signed for f64 {
287287
#[inline]
288288
fn abs(&self) -> f64 { abs(*self) }
289289

290-
///
291290
/// The positive difference of two numbers. Returns `0.0` if the number is less than or
292291
/// equal to `other`, otherwise the difference between`self` and `other` is returned.
293-
///
294292
#[inline]
295293
fn abs_sub(&self, other: &f64) -> f64 { abs_sub(*self, *other) }
296294

297-
///
298295
/// # Returns
299296
///
300297
/// - `1.0` if the number is positive, `+0.0` or `INFINITY`
301298
/// - `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY`
302299
/// - `NAN` if the number is NaN
303-
///
304300
#[inline]
305301
fn signum(&self) -> f64 {
306302
if self.is_nan() { NAN } else { copysign(1.0, *self) }
@@ -332,14 +328,12 @@ impl Round for f64 {
332328
#[inline]
333329
fn trunc(&self) -> f64 { trunc(*self) }
334330

335-
///
336331
/// The fractional part of the number, satisfying:
337332
///
338333
/// ```rust
339334
/// let x = 1.65f64;
340335
/// assert!(x == x.trunc() + x.fract())
341336
/// ```
342-
///
343337
#[inline]
344338
fn fract(&self) -> f64 { *self - self.trunc() }
345339
}
@@ -492,15 +486,13 @@ impl Real for f64 {
492486
#[inline]
493487
fn tanh(&self) -> f64 { tanh(*self) }
494488

495-
///
496489
/// Inverse hyperbolic sine
497490
///
498491
/// # Returns
499492
///
500493
/// - on success, the inverse hyperbolic sine of `self` will be returned
501494
/// - `self` if `self` is `0.0`, `-0.0`, `INFINITY`, or `NEG_INFINITY`
502495
/// - `NAN` if `self` is `NAN`
503-
///
504496
#[inline]
505497
fn asinh(&self) -> f64 {
506498
match *self {
@@ -509,15 +501,13 @@ impl Real for f64 {
509501
}
510502
}
511503

512-
///
513504
/// Inverse hyperbolic cosine
514505
///
515506
/// # Returns
516507
///
517508
/// - on success, the inverse hyperbolic cosine of `self` will be returned
518509
/// - `INFINITY` if `self` is `INFINITY`
519510
/// - `NAN` if `self` is `NAN` or `self < 1.0` (including `NEG_INFINITY`)
520-
///
521511
#[inline]
522512
fn acosh(&self) -> f64 {
523513
match *self {
@@ -526,7 +516,6 @@ impl Real for f64 {
526516
}
527517
}
528518

529-
///
530519
/// Inverse hyperbolic tangent
531520
///
532521
/// # Returns
@@ -537,7 +526,6 @@ impl Real for f64 {
537526
/// - `NEG_INFINITY` if `self` is `-1.0`
538527
/// - `NAN` if the `self` is `NAN` or outside the domain of `-1.0 <= self <= 1.0`
539528
/// (including `INFINITY` and `NEG_INFINITY`)
540-
///
541529
#[inline]
542530
fn atanh(&self) -> f64 {
543531
0.5 * ((2.0 * *self) / (1.0 - *self)).ln_1p()
@@ -645,38 +633,30 @@ impl Float for f64 {
645633
ldexp(x, exp as c_int)
646634
}
647635

648-
///
649636
/// Breaks the number into a normalized fraction and a base-2 exponent, satisfying:
650637
///
651638
/// - `self = x * pow(2, exp)`
652639
/// - `0.5 <= abs(x) < 1.0`
653-
///
654640
#[inline]
655641
fn frexp(&self) -> (f64, int) {
656642
let mut exp = 0;
657643
let x = frexp(*self, &mut exp);
658644
(x, exp as int)
659645
}
660646

661-
///
662647
/// Returns the exponential of the number, minus `1`, in a way that is accurate
663648
/// even if the number is close to zero
664-
///
665649
#[inline]
666650
fn exp_m1(&self) -> f64 { exp_m1(*self) }
667651

668-
///
669652
/// Returns the natural logarithm of the number plus `1` (`ln(1+n)`) more accurately
670653
/// than if the operations were performed separately
671-
///
672654
#[inline]
673655
fn ln_1p(&self) -> f64 { ln_1p(*self) }
674656

675-
///
676657
/// Fused multiply-add. Computes `(self * a) + b` with only one rounding error. This
677658
/// produces a more accurate result with better performance than a separate multiplication
678659
/// operation followed by an add.
679-
///
680660
#[inline]
681661
fn mul_add(&self, a: f64, b: f64) -> f64 {
682662
mul_add(*self, a, b)
@@ -710,82 +690,71 @@ impl Float for f64 {
710690
// Section: String Conversions
711691
//
712692

713-
///
714693
/// Converts a float to a string
715694
///
716695
/// # Arguments
717696
///
718697
/// * num - The float value
719-
///
720698
#[inline]
721699
pub fn to_str(num: f64) -> ~str {
722700
let (r, _) = strconv::float_to_str_common(
723701
num, 10u, true, strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false);
724702
r
725703
}
726704

727-
///
728705
/// Converts a float to a string in hexadecimal format
729706
///
730707
/// # Arguments
731708
///
732709
/// * num - The float value
733-
///
734710
#[inline]
735711
pub fn to_str_hex(num: f64) -> ~str {
736712
let (r, _) = strconv::float_to_str_common(
737713
num, 16u, true, strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false);
738714
r
739715
}
740716

741-
///
742717
/// Converts a float to a string in a given radix, and a flag indicating
743718
/// whether it's a special value
744719
///
745720
/// # Arguments
746721
///
747722
/// * num - The float value
748723
/// * radix - The base to use
749-
///
750724
#[inline]
751725
pub fn to_str_radix_special(num: f64, rdx: uint) -> (~str, bool) {
752726
strconv::float_to_str_common(num, rdx, true,
753727
strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false)
754728
}
755729

756-
///
757730
/// Converts a float to a string with exactly the number of
758731
/// provided significant digits
759732
///
760733
/// # Arguments
761734
///
762735
/// * num - The float value
763736
/// * digits - The number of significant digits
764-
///
765737
#[inline]
766738
pub fn to_str_exact(num: f64, dig: uint) -> ~str {
767739
let (r, _) = strconv::float_to_str_common(
768740
num, 10u, true, strconv::SignNeg, strconv::DigExact(dig), strconv::ExpNone, false);
769741
r
770742
}
771743

772-
///
773744
/// Converts a float to a string with a maximum number of
774745
/// significant digits
775746
///
776747
/// # Arguments
777748
///
778749
/// * num - The float value
779750
/// * digits - The number of significant digits
780-
///
781751
#[inline]
782752
pub fn to_str_digits(num: f64, dig: uint) -> ~str {
783753
let (r, _) = strconv::float_to_str_common(
784754
num, 10u, true, strconv::SignNeg, strconv::DigMax(dig), strconv::ExpNone, false);
785755
r
786756
}
787757

788-
///
789758
/// Converts a float to a string using the exponential notation with exactly the number of
790759
/// provided digits after the decimal point in the significand
791760
///
@@ -794,15 +763,13 @@ pub fn to_str_digits(num: f64, dig: uint) -> ~str {
794763
/// * num - The float value
795764
/// * digits - The number of digits after the decimal point
796765
/// * upper - Use `E` instead of `e` for the exponent sign
797-
///
798766
#[inline]
799767
pub fn to_str_exp_exact(num: f64, dig: uint, upper: bool) -> ~str {
800768
let (r, _) = strconv::float_to_str_common(
801769
num, 10u, true, strconv::SignNeg, strconv::DigExact(dig), strconv::ExpDec, upper);
802770
r
803771
}
804772

805-
///
806773
/// Converts a float to a string using the exponential notation with the maximum number of
807774
/// digits after the decimal point in the significand
808775
///
@@ -811,7 +778,6 @@ pub fn to_str_exp_exact(num: f64, dig: uint, upper: bool) -> ~str {
811778
/// * num - The float value
812779
/// * digits - The number of digits after the decimal point
813780
/// * upper - Use `E` instead of `e` for the exponent sign
814-
///
815781
#[inline]
816782
pub fn to_str_exp_digits(num: f64, dig: uint, upper: bool) -> ~str {
817783
let (r, _) = strconv::float_to_str_common(
@@ -847,7 +813,6 @@ impl num::ToStrRadix for f64 {
847813
}
848814
}
849815

850-
///
851816
/// Convert a string in base 16 to a float.
852817
/// Accepts a optional binary exponent.
853818
///
@@ -873,15 +838,13 @@ impl num::ToStrRadix for f64 {
873838
///
874839
/// `None` if the string did not represent a valid number. Otherwise,
875840
/// `Some(n)` where `n` is the floating-point number represented by `[num]`.
876-
///
877841
#[inline]
878842
pub fn from_str_hex(num: &str) -> Option<f64> {
879843
strconv::from_str_common(num, 16u, true, true, true,
880844
strconv::ExpBin, false, false)
881845
}
882846

883847
impl FromStr for f64 {
884-
///
885848
/// Convert a string in base 10 to a float.
886849
/// Accepts a optional decimal exponent.
887850
///
@@ -907,7 +870,6 @@ impl FromStr for f64 {
907870
///
908871
/// `none` if the string did not represent a valid number. Otherwise,
909872
/// `Some(n)` where `n` is the floating-point number represented by `num`.
910-
///
911873
#[inline]
912874
fn from_str(val: &str) -> Option<f64> {
913875
strconv::from_str_common(val, 10u, true, true, true,
@@ -916,7 +878,6 @@ impl FromStr for f64 {
916878
}
917879

918880
impl num::FromStrRadix for f64 {
919-
///
920881
/// Convert a string in an given base to a float.
921882
///
922883
/// Due to possible conflicts, this function does **not** accept
@@ -934,7 +895,6 @@ impl num::FromStrRadix for f64 {
934895
///
935896
/// `None` if the string did not represent a valid number. Otherwise,
936897
/// `Some(n)` where `n` is the floating-point number represented by `num`.
937-
///
938898
#[inline]
939899
fn from_str_radix(val: &str, rdx: uint) -> Option<f64> {
940900
strconv::from_str_common(val, rdx, true, true, false,

5 commit comments

Comments
 (5)

bors commented on Jan 23, 2014

@bors
Collaborator

saw approval from alexcrichton
at SiegeLord@acd718b

bors commented on Jan 23, 2014

@bors
Collaborator

merging SiegeLord/rust/exp_printing = acd718b into auto

bors commented on Jan 23, 2014

@bors
Collaborator

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

bors commented on Jan 23, 2014

@bors
Collaborator

fast-forwarding master to auto = 52ba3b6

Please sign in to comment.