@@ -304,13 +304,13 @@ impl Signed for f32 {
304
304
#[ inline( always) ]
305
305
fn abs ( & self ) -> f32 { abs ( * self ) }
306
306
307
- /**
308
- * # Returns
309
- *
310
- * - `1.0` if the number is positive, `+0.0` or `infinity`
311
- * - `-1.0` if the number is negative, `-0.0` or `neg_infinity`
312
- * - `NaN` if the number is ` NaN`
313
- * /
307
+ ///
308
+ /// # Returns
309
+ ///
310
+ /// - `1.0` if the number is positive, `+0.0` or `infinity`
311
+ /// - `-1.0` if the number is negative, `-0.0` or `neg_infinity`
312
+ /// - `NaN` if the number is NaN
313
+ // /
314
314
#[ inline( always) ]
315
315
fn signum ( & self ) -> f32 {
316
316
if is_NaN ( * self ) { NaN } else { copysign ( 1.0 , * self ) }
@@ -509,52 +509,52 @@ impl Real for f32 {
509
509
fn tanh ( & self ) -> f32 { tanh ( * self ) }
510
510
}
511
511
512
- /**
513
- * Section: String Conversions
514
- * /
512
+ //
513
+ // Section: String Conversions
514
+ / /
515
515
516
- /**
517
- * Converts a float to a string
518
- *
519
- * # Arguments
520
- *
521
- * * num - The float value
522
- * /
516
+ ///
517
+ /// Converts a float to a string
518
+ ///
519
+ /// # Arguments
520
+ ///
521
+ /// * num - The float value
522
+ // /
523
523
#[ inline( always) ]
524
524
pub fn to_str ( num : f32 ) -> ~str {
525
525
let ( r, _) = strconv:: to_str_common (
526
526
& num, 10 u, true , strconv:: SignNeg , strconv:: DigAll ) ;
527
527
r
528
528
}
529
529
530
- /**
531
- * Converts a float to a string in hexadecimal format
532
- *
533
- * # Arguments
534
- *
535
- * * num - The float value
536
- * /
530
+ ///
531
+ /// Converts a float to a string in hexadecimal format
532
+ ///
533
+ /// # Arguments
534
+ ///
535
+ /// * num - The float value
536
+ // /
537
537
#[ inline( always) ]
538
538
pub fn to_str_hex ( num : f32 ) -> ~str {
539
539
let ( r, _) = strconv:: to_str_common (
540
540
& num, 16 u, true , strconv:: SignNeg , strconv:: DigAll ) ;
541
541
r
542
542
}
543
543
544
- /**
545
- * Converts a float to a string in a given radix
546
- *
547
- * # Arguments
548
- *
549
- * * num - The float value
550
- * * radix - The base to use
551
- *
552
- * # Failure
553
- *
554
- * Fails if called on a special value like `inf`, `-inf` or `NaN` due to
555
- * possible misinterpretation of the result at higher bases. If those values
556
- * are expected, use `to_str_radix_special()` instead.
557
- * /
544
+ ///
545
+ /// Converts a float to a string in a given radix
546
+ ///
547
+ /// # Arguments
548
+ ///
549
+ /// * num - The float value
550
+ /// * radix - The base to use
551
+ ///
552
+ /// # Failure
553
+ ///
554
+ /// Fails if called on a special value like `inf`, `-inf` or `NaN` due to
555
+ /// possible misinterpretation of the result at higher bases. If those values
556
+ /// are expected, use `to_str_radix_special()` instead.
557
+ // /
558
558
#[ inline( always) ]
559
559
pub fn to_str_radix ( num : f32 , rdx : uint ) -> ~str {
560
560
let ( r, special) = strconv:: to_str_common (
@@ -564,46 +564,46 @@ pub fn to_str_radix(num: f32, rdx: uint) -> ~str {
564
564
r
565
565
}
566
566
567
- /**
568
- * Converts a float to a string in a given radix, and a flag indicating
569
- * whether it's a special value
570
- *
571
- * # Arguments
572
- *
573
- * * num - The float value
574
- * * radix - The base to use
575
- * /
567
+ ///
568
+ /// Converts a float to a string in a given radix, and a flag indicating
569
+ /// whether it's a special value
570
+ ///
571
+ /// # Arguments
572
+ ///
573
+ /// * num - The float value
574
+ /// * radix - The base to use
575
+ // /
576
576
#[inline(always)]
577
577
pub fn to_str_radix_special(num: f32, rdx: uint) -> (~str, bool) {
578
578
strconv::to_str_common(&num, rdx, true,
579
579
strconv::SignNeg, strconv::DigAll)
580
580
}
581
581
582
- /**
583
- * Converts a float to a string with exactly the number of
584
- * provided significant digits
585
- *
586
- * # Arguments
587
- *
588
- * * num - The float value
589
- * * digits - The number of significant digits
590
- * /
582
+ ///
583
+ /// Converts a float to a string with exactly the number of
584
+ /// provided significant digits
585
+ ///
586
+ /// # Arguments
587
+ ///
588
+ /// * num - The float value
589
+ /// * digits - The number of significant digits
590
+ // /
591
591
#[inline(always)]
592
592
pub fn to_str_exact(num: f32, dig: uint) -> ~str {
593
593
let (r, _) = strconv::to_str_common(
594
594
&num, 10u, true, strconv::SignNeg, strconv::DigExact(dig));
595
595
r
596
596
}
597
597
598
- /**
599
- * Converts a float to a string with a maximum number of
600
- * significant digits
601
- *
602
- * # Arguments
603
- *
604
- * * num - The float value
605
- * * digits - The number of significant digits
606
- * /
598
+ ///
599
+ /// Converts a float to a string with a maximum number of
600
+ /// significant digits
601
+ ///
602
+ /// # Arguments
603
+ ///
604
+ /// * num - The float value
605
+ /// * digits - The number of significant digits
606
+ // /
607
607
#[inline(always)]
608
608
pub fn to_str_digits(num: f32, dig: uint) -> ~str {
609
609
let (r, _) = strconv::to_str_common(
@@ -623,91 +623,91 @@ impl num::ToStrRadix for f32 {
623
623
}
624
624
}
625
625
626
- /**
627
- * Convert a string in base 10 to a float.
628
- * Accepts a optional decimal exponent.
629
- *
630
- * This function accepts strings such as
631
- *
632
- * * '3.14'
633
- * * '+3.14', equivalent to '3.14'
634
- * * '-3.14'
635
- * * '2.5E10', or equivalently, '2.5e10'
636
- * * '2.5E-10'
637
- * * '.' (understood as 0)
638
- * * '5.'
639
- * * '.5', or, equivalently, '0.5'
640
- * * '+inf', 'inf', '-inf', 'NaN'
641
- *
642
- * Leading and trailing whitespace represent an error.
643
- *
644
- * # Arguments
645
- *
646
- * * num - A string
647
- *
648
- * # Return value
649
- *
650
- * `none` if the string did not represent a valid number. Otherwise,
651
- * `Some(n)` where `n` is the floating-point number represented by `num`.
652
- * /
626
+ ///
627
+ /// Convert a string in base 10 to a float.
628
+ /// Accepts a optional decimal exponent.
629
+ ///
630
+ /// This function accepts strings such as
631
+ ///
632
+ /// * '3.14'
633
+ /// * '+3.14', equivalent to '3.14'
634
+ /// * '-3.14'
635
+ /// * '2.5E10', or equivalently, '2.5e10'
636
+ /// * '2.5E-10'
637
+ /// * '.' (understood as 0)
638
+ /// * '5.'
639
+ /// * '.5', or, equivalently, '0.5'
640
+ /// * '+inf', 'inf', '-inf', 'NaN'
641
+ ///
642
+ /// Leading and trailing whitespace represent an error.
643
+ ///
644
+ /// # Arguments
645
+ ///
646
+ /// * num - A string
647
+ ///
648
+ /// # Return value
649
+ ///
650
+ /// `none` if the string did not represent a valid number. Otherwise,
651
+ /// `Some(n)` where `n` is the floating-point number represented by `num`.
652
+ // /
653
653
#[inline(always)]
654
654
pub fn from_str(num: &str) -> Option<f32> {
655
655
strconv::from_str_common(num, 10u, true, true, true,
656
656
strconv::ExpDec, false, false)
657
657
}
658
658
659
- /**
660
- * Convert a string in base 16 to a float.
661
- * Accepts a optional binary exponent.
662
- *
663
- * This function accepts strings such as
664
- *
665
- * * 'a4.fe'
666
- * * '+a4.fe', equivalent to 'a4.fe'
667
- * * '-a4.fe'
668
- * * '2b.aP128', or equivalently, '2b.ap128'
669
- * * '2b.aP-128'
670
- * * '.' (understood as 0)
671
- * * 'c.'
672
- * * '.c', or, equivalently, '0.c'
673
- * * '+inf', 'inf', '-inf', 'NaN'
674
- *
675
- * Leading and trailing whitespace represent an error.
676
- *
677
- * # Arguments
678
- *
679
- * * num - A string
680
- *
681
- * # Return value
682
- *
683
- * `none` if the string did not represent a valid number. Otherwise,
684
- * `Some(n)` where `n` is the floating-point number represented by `[num]`.
685
- * /
659
+ ///
660
+ /// Convert a string in base 16 to a float.
661
+ /// Accepts a optional binary exponent.
662
+ ///
663
+ /// This function accepts strings such as
664
+ ///
665
+ /// * 'a4.fe'
666
+ /// * '+a4.fe', equivalent to 'a4.fe'
667
+ /// * '-a4.fe'
668
+ /// * '2b.aP128', or equivalently, '2b.ap128'
669
+ /// * '2b.aP-128'
670
+ /// * '.' (understood as 0)
671
+ /// * 'c.'
672
+ /// * '.c', or, equivalently, '0.c'
673
+ /// * '+inf', 'inf', '-inf', 'NaN'
674
+ ///
675
+ /// Leading and trailing whitespace represent an error.
676
+ ///
677
+ /// # Arguments
678
+ ///
679
+ /// * num - A string
680
+ ///
681
+ /// # Return value
682
+ ///
683
+ /// `none` if the string did not represent a valid number. Otherwise,
684
+ /// `Some(n)` where `n` is the floating-point number represented by `[num]`.
685
+ // /
686
686
#[inline(always)]
687
687
pub fn from_str_hex(num: &str) -> Option<f32> {
688
688
strconv::from_str_common(num, 16u, true, true, true,
689
689
strconv::ExpBin, false, false)
690
690
}
691
691
692
- /**
693
- * Convert a string in an given base to a float.
694
- *
695
- * Due to possible conflicts, this function does **not** accept
696
- * the special values `inf`, `-inf`, `+inf` and `NaN`, **nor**
697
- * does it recognize exponents of any kind.
698
- *
699
- * Leading and trailing whitespace represent an error.
700
- *
701
- * # Arguments
702
- *
703
- * * num - A string
704
- * * radix - The base to use. Must lie in the range [2 .. 36]
705
- *
706
- * # Return value
707
- *
708
- * `none` if the string did not represent a valid number. Otherwise,
709
- * `Some(n)` where `n` is the floating-point number represented by `num`.
710
- * /
692
+ ///
693
+ /// Convert a string in an given base to a float.
694
+ ///
695
+ /// Due to possible conflicts, this function does **not** accept
696
+ /// the special values `inf`, `-inf`, `+inf` and `NaN`, **nor**
697
+ /// does it recognize exponents of any kind.
698
+ ///
699
+ /// Leading and trailing whitespace represent an error.
700
+ ///
701
+ /// # Arguments
702
+ ///
703
+ /// * num - A string
704
+ /// * radix - The base to use. Must lie in the range [2 .. 36]
705
+ ///
706
+ /// # Return value
707
+ ///
708
+ /// `none` if the string did not represent a valid number. Otherwise,
709
+ /// `Some(n)` where `n` is the floating-point number represented by `num`.
710
+ // /
711
711
#[inline(always)]
712
712
pub fn from_str_radix(num: &str, rdx: uint) -> Option<f32> {
713
713
strconv::from_str_common(num, rdx, true, true, false,
0 commit comments