@@ -15,9 +15,10 @@ macro_rules! overflowing_impl {
1515 } ;
1616}
1717
18- /// If an overflow would have occurred then the wrapped value is returned .
18+ /// Performs addition with a flag for overflow .
1919pub trait OverflowingAdd : Sized + Add < Self , Output = Self > {
2020 /// Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur.
21+ /// If an overflow would have occurred then the wrapped value is returned.
2122 fn overflowing_add ( & self , v : & Self ) -> ( Self , bool ) ;
2223}
2324
@@ -37,9 +38,10 @@ overflowing_impl!(OverflowingAdd, overflowing_add, isize);
3738#[ cfg( has_i128) ]
3839overflowing_impl ! ( OverflowingAdd , overflowing_add, i128 ) ;
3940
40- /// If an overflow would have occurred then the wrapped value is returned .
41+ /// Performs substraction with a flag for overflow .
4142pub trait OverflowingSub : Sized + Sub < Self , Output = Self > {
4243 /// Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur.
44+ /// If an overflow would have occurred then the wrapped value is returned.
4345 fn overflowing_sub ( & self , v : & Self ) -> ( Self , bool ) ;
4446}
4547
@@ -59,9 +61,10 @@ overflowing_impl!(OverflowingSub, overflowing_sub, isize);
5961#[ cfg( has_i128) ]
6062overflowing_impl ! ( OverflowingSub , overflowing_sub, i128 ) ;
6163
62- /// If an overflow would have occurred then the wrapped value is returned .
64+ /// Performs multiplication with a flag for overflow .
6365pub trait OverflowingMul : Sized + Mul < Self , Output = Self > {
6466 /// Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur.
67+ /// If an overflow would have occurred then the wrapped value is returned.
6568 fn overflowing_mul ( & self , v : & Self ) -> ( Self , bool ) ;
6669}
6770
0 commit comments