Public static intABS(Int)
-
Return
Int
The absolute value of the value. If the parameter is not negative, this parameter is returned. If the parameter is a negative number, the opposite number of this parameter is returned.
Note: If the parameter is equalInteger. min_value
(That is, the minimum negative value that can be expressed)Int
Value), the result is the same as the value and is negative.
Public static longABS(Long)
-
Return
Long
The absolute value of the value. If the parameter is not negative, this parameter is returned. If the parameter is a negative number, the opposite number of this parameter is returned.
Note: If the parameter is equalLong. min_value
(That is, the minimum negative value that can be expressed)Long
Value), the result is the same as the value and is negative.
Public static floatABS(Float)
-
Return
Float
The absolute value of the value. If the parameter is not negative, this parameter is returned. If the parameter is a negative number, the opposite number of this parameter is returned. In special cases:
- If the parameter is positive zero or negative zero, the result is positive zero.
- If the parameter is infinite, the result is positive infinity.
- If the parameter is Nan, the result is Nan.
In other words, the result is equal to the value of the following expression:
Float. intbitstofloat (0x7fffffff & float. floattointbits ())
Public static doubleABS(Double)
-
Return
Double
The absolute value of the value. If the parameter is not negative, this parameter is returned. If the parameter is a negative number, the opposite number of this parameter is returned. In special cases:
- If the parameter is positive zero or negative zero, the result is positive zero.
- If the parameter is infinite, the result is positive infinity.
- If the parameter is Nan, the result is Nan.
In other words, the result is equal to the value of the following expression:
Double. longbitstodouble (double. doubletolongbits (a) <1) >>> 1)