@@ -160,6 +160,8 @@ pub trait Signed: Num + Neg<Self> {
160
160
/// Computes the absolute value.
161
161
///
162
162
/// For `f32` and `f64`, `NaN` will be returned if the number is `NaN`.
163
+ ///
164
+ /// For signed integers, `::MIN` will be returned if the number is `::MIN`.
163
165
fn abs ( & self ) -> Self ;
164
166
165
167
/// The positive difference of two numbers.
@@ -176,7 +178,7 @@ pub trait Signed: Num + Neg<Self> {
176
178
/// * `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY`
177
179
/// * `NaN` if the number is `NaN`
178
180
///
179
- /// For `int` :
181
+ /// For signed integers :
180
182
///
181
183
/// * `0` if the number is zero
182
184
/// * `1` if the number is positive
@@ -272,6 +274,8 @@ signed_float_impl!(f64, f64::NAN, f64::INFINITY, f64::NEG_INFINITY,
272
274
/// Computes the absolute value.
273
275
///
274
276
/// For `f32` and `f64`, `NaN` will be returned if the number is `NaN`
277
+ ///
278
+ /// For signed integers, `::MIN` will be returned if the number is `::MIN`.
275
279
#[ inline( always) ]
276
280
pub fn abs < T : Signed > ( value : T ) -> T {
277
281
value. abs ( )
@@ -294,7 +298,7 @@ pub fn abs_sub<T: Signed>(x: T, y: T) -> T {
294
298
/// * `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY`
295
299
/// * `NaN` if the number is `NaN`
296
300
///
297
- /// For int :
301
+ /// For signed integers :
298
302
///
299
303
/// * `0` if the number is zero
300
304
/// * `1` if the number is positive
0 commit comments