@@ -40,6 +40,7 @@ impl f32 {
40
40
/// assert_eq!(g.floor(), 3.0);
41
41
/// assert_eq!(h.floor(), -4.0);
42
42
/// ```
43
+ #[ must_use]
43
44
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
44
45
#[ inline]
45
46
pub fn floor ( self ) -> f32 {
@@ -73,6 +74,7 @@ impl f32 {
73
74
/// assert_eq!(f.ceil(), 4.0);
74
75
/// assert_eq!(g.ceil(), 4.0);
75
76
/// ```
77
+ #[ must_use]
76
78
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
77
79
#[ inline]
78
80
pub fn ceil ( self ) -> f32 {
@@ -95,6 +97,7 @@ impl f32 {
95
97
/// assert_eq!(f.round(), 3.0);
96
98
/// assert_eq!(g.round(), -3.0);
97
99
/// ```
100
+ #[ must_use]
98
101
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
99
102
#[ inline]
100
103
pub fn round ( self ) -> f32 {
@@ -114,6 +117,7 @@ impl f32 {
114
117
/// assert_eq!(g.trunc(), 3.0);
115
118
/// assert_eq!(h.trunc(), -3.0);
116
119
/// ```
120
+ #[ must_use]
117
121
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
118
122
#[ inline]
119
123
pub fn trunc ( self ) -> f32 {
@@ -135,6 +139,7 @@ impl f32 {
135
139
/// assert!(abs_difference_x <= f32::EPSILON);
136
140
/// assert!(abs_difference_y <= f32::EPSILON);
137
141
/// ```
142
+ #[ must_use]
138
143
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
139
144
#[ inline]
140
145
pub fn fract ( self ) -> f32 { self - self . trunc ( ) }
@@ -158,6 +163,7 @@ impl f32 {
158
163
///
159
164
/// assert!(f32::NAN.abs().is_nan());
160
165
/// ```
166
+ #[ must_use]
161
167
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
162
168
#[ inline]
163
169
pub fn abs ( self ) -> f32 {
@@ -182,6 +188,7 @@ impl f32 {
182
188
///
183
189
/// assert!(f32::NAN.signum().is_nan());
184
190
/// ```
191
+ #[ must_use]
185
192
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
186
193
#[ inline]
187
194
pub fn signum ( self ) -> f32 {
@@ -367,6 +374,7 @@ impl f32 {
367
374
/// assert!(abs_difference <= f32::EPSILON);
368
375
/// assert!(negative.sqrt().is_nan());
369
376
/// ```
377
+ #[ must_use]
370
378
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
371
379
#[ inline]
372
380
pub fn sqrt ( self ) -> f32 {
@@ -393,6 +401,7 @@ impl f32 {
393
401
///
394
402
/// assert!(abs_difference <= f32::EPSILON);
395
403
/// ```
404
+ #[ must_use]
396
405
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
397
406
#[ inline]
398
407
pub fn exp ( self ) -> f32 {
@@ -417,6 +426,7 @@ impl f32 {
417
426
///
418
427
/// assert!(abs_difference <= f32::EPSILON);
419
428
/// ```
429
+ #[ must_use]
420
430
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
421
431
#[ inline]
422
432
pub fn exp2 ( self ) -> f32 {
@@ -439,6 +449,7 @@ impl f32 {
439
449
///
440
450
/// assert!(abs_difference <= f32::EPSILON);
441
451
/// ```
452
+ #[ must_use]
442
453
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
443
454
#[ inline]
444
455
pub fn ln ( self ) -> f32 {
@@ -485,6 +496,7 @@ impl f32 {
485
496
///
486
497
/// assert!(abs_difference <= f32::EPSILON);
487
498
/// ```
499
+ #[ must_use]
488
500
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
489
501
#[ inline]
490
502
pub fn log2 ( self ) -> f32 {
@@ -508,6 +520,7 @@ impl f32 {
508
520
///
509
521
/// assert!(abs_difference <= f32::EPSILON);
510
522
/// ```
523
+ #[ must_use]
511
524
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
512
525
#[ inline]
513
526
pub fn log10 ( self ) -> f32 {
@@ -565,6 +578,7 @@ impl f32 {
565
578
///
566
579
/// assert!(abs_difference <= f32::EPSILON);
567
580
/// ```
581
+ #[ must_use]
568
582
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
569
583
#[ inline]
570
584
pub fn cbrt ( self ) -> f32 {
@@ -606,6 +620,7 @@ impl f32 {
606
620
///
607
621
/// assert!(abs_difference <= f32::EPSILON);
608
622
/// ```
623
+ #[ must_use]
609
624
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
610
625
#[ inline]
611
626
pub fn sin ( self ) -> f32 {
@@ -629,6 +644,7 @@ impl f32 {
629
644
///
630
645
/// assert!(abs_difference <= f32::EPSILON);
631
646
/// ```
647
+ #[ must_use]
632
648
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
633
649
#[ inline]
634
650
pub fn cos ( self ) -> f32 {
@@ -651,6 +667,7 @@ impl f32 {
651
667
///
652
668
/// assert!(abs_difference <= f32::EPSILON);
653
669
/// ```
670
+ #[ must_use]
654
671
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
655
672
#[ inline]
656
673
pub fn tan ( self ) -> f32 {
@@ -673,6 +690,7 @@ impl f32 {
673
690
///
674
691
/// assert!(abs_difference <= f32::EPSILON);
675
692
/// ```
693
+ #[ must_use]
676
694
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
677
695
#[ inline]
678
696
pub fn asin ( self ) -> f32 {
@@ -695,6 +713,7 @@ impl f32 {
695
713
///
696
714
/// assert!(abs_difference <= f32::EPSILON);
697
715
/// ```
716
+ #[ must_use]
698
717
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
699
718
#[ inline]
700
719
pub fn acos ( self ) -> f32 {
@@ -716,6 +735,7 @@ impl f32 {
716
735
///
717
736
/// assert!(abs_difference <= f32::EPSILON);
718
737
/// ```
738
+ #[ must_use]
719
739
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
720
740
#[ inline]
721
741
pub fn atan ( self ) -> f32 {
@@ -794,6 +814,7 @@ impl f32 {
794
814
///
795
815
/// assert!(abs_difference <= f32::EPSILON);
796
816
/// ```
817
+ #[ must_use]
797
818
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
798
819
#[ inline]
799
820
pub fn exp_m1 ( self ) -> f32 {
@@ -815,6 +836,7 @@ impl f32 {
815
836
///
816
837
/// assert!(abs_difference <= f32::EPSILON);
817
838
/// ```
839
+ #[ must_use]
818
840
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
819
841
#[ inline]
820
842
pub fn ln_1p ( self ) -> f32 {
@@ -838,6 +860,7 @@ impl f32 {
838
860
///
839
861
/// assert!(abs_difference <= f32::EPSILON);
840
862
/// ```
863
+ #[ must_use]
841
864
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
842
865
#[ inline]
843
866
pub fn sinh ( self ) -> f32 {
@@ -861,6 +884,7 @@ impl f32 {
861
884
/// // Same result
862
885
/// assert!(abs_difference <= f32::EPSILON);
863
886
/// ```
887
+ #[ must_use]
864
888
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
865
889
#[ inline]
866
890
pub fn cosh ( self ) -> f32 {
@@ -884,6 +908,7 @@ impl f32 {
884
908
///
885
909
/// assert!(abs_difference <= f32::EPSILON);
886
910
/// ```
911
+ #[ must_use]
887
912
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
888
913
#[ inline]
889
914
pub fn tanh ( self ) -> f32 {
@@ -904,6 +929,7 @@ impl f32 {
904
929
///
905
930
/// assert!(abs_difference <= f32::EPSILON);
906
931
/// ```
932
+ #[ must_use]
907
933
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
908
934
#[ inline]
909
935
pub fn asinh ( self ) -> f32 {
@@ -928,6 +954,7 @@ impl f32 {
928
954
///
929
955
/// assert!(abs_difference <= f32::EPSILON);
930
956
/// ```
957
+ #[ must_use]
931
958
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
932
959
#[ inline]
933
960
pub fn acosh ( self ) -> f32 {
@@ -951,6 +978,7 @@ impl f32 {
951
978
///
952
979
/// assert!(abs_difference <= 1e-5);
953
980
/// ```
981
+ #[ must_use]
954
982
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
955
983
#[ inline]
956
984
pub fn atanh ( self ) -> f32 {
0 commit comments