Returns the absolute value of the argument. Special cases: abs(-0.0) = +0.0 abs(+infinity) = +infinity abs(-infinity) = +infinity abs(NaN) = NaN @param d the value whose absolute value has to be computed.
(double d)
| 58 | * @return the absolute value of the argument. |
| 59 | */ |
| 60 | public static double abs(double d) { |
| 61 | long bits = Double.doubleToLongBits(d); |
| 62 | bits &= 0x7fffffffffffffffL; |
| 63 | return Double.longBitsToDouble(bits); |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * Returns the absolute value of the argument. |
no test coverage detected