@@ -32,9 +32,9 @@ checked_impl!(CheckedAdd, checked_add, i64);
3232checked_impl ! ( CheckedAdd , checked_add, isize ) ;
3333checked_impl ! ( CheckedAdd , checked_add, i128 ) ;
3434
35- /// Performs subtraction, returning `None` if underflow occurred.
35+ /// Performs subtraction, returning `None` if overflow occurred.
3636pub trait CheckedSub : Sized + Sub < Self , Output = Self > {
37- /// Subtracts two numbers, checking for underflow . If underflow happens,
37+ /// Subtracts two numbers, checking for overflow . If overflow happens,
3838 /// `None` is returned.
3939 fn checked_sub ( & self , v : & Self ) -> Option < Self > ;
4040}
@@ -53,11 +53,10 @@ checked_impl!(CheckedSub, checked_sub, i64);
5353checked_impl ! ( CheckedSub , checked_sub, isize ) ;
5454checked_impl ! ( CheckedSub , checked_sub, i128 ) ;
5555
56- /// Performs multiplication, returning `None` if underflow or overflow
57- /// occurred.
56+ /// Performs multiplication, returning `None` if overflow occurred.
5857pub trait CheckedMul : Sized + Mul < Self , Output = Self > {
59- /// Multiplies two numbers, checking for underflow or overflow. If underflow
60- /// or overflow happens, `None` is returned.
58+ /// Multiplies two numbers, checking for overflow. If overflow happens,
59+ /// `None` is returned.
6160 fn checked_mul ( & self , v : & Self ) -> Option < Self > ;
6261}
6362
@@ -75,10 +74,10 @@ checked_impl!(CheckedMul, checked_mul, i64);
7574checked_impl ! ( CheckedMul , checked_mul, isize ) ;
7675checked_impl ! ( CheckedMul , checked_mul, i128 ) ;
7776
78- /// Performs division, returning `None` on division by zero or if underflow or
79- /// overflow occurred.
77+ /// Performs division, returning `None` on division by zero or if overflow
78+ /// occurred.
8079pub trait CheckedDiv : Sized + Div < Self , Output = Self > {
81- /// Divides two numbers, checking for underflow, overflow and division by
80+ /// Divides two numbers, checking for overflow and division by
8281 /// zero. If any of that happens, `None` is returned.
8382 fn checked_div ( & self , v : & Self ) -> Option < Self > ;
8483}
@@ -98,10 +97,10 @@ checked_impl!(CheckedDiv, checked_div, isize);
9897checked_impl ! ( CheckedDiv , checked_div, i128 ) ;
9998
10099/// Performs integral remainder, returning `None` on division by zero or if
101- /// underflow or overflow occurred.
100+ /// overflow occurred.
102101pub trait CheckedRem : Sized + Rem < Self , Output = Self > {
103- /// Finds the remainder of dividing two numbers, checking for underflow, overflow and division
104- /// by zero. If any of that happens, `None` is returned.
102+ /// Finds the remainder of dividing two numbers, checking for overflow and
103+ /// division by zero. If any of that happens, `None` is returned.
105104 ///
106105 /// # Examples
107106 ///
0 commit comments