< prev index next >
src/java.base/share/classes/java/lang/Math.java
Print this page
*** 1351,1360 ****
--- 1351,1361 ----
* negative.
*
* @param a the argument whose absolute value is to be determined
* @return the absolute value of the argument.
*/
+ @HotSpotIntrinsicCandidate
public static int abs(int a) {
return (a < 0) ? -a : a;
}
/**
*** 1368,1377 ****
--- 1369,1379 ----
* is negative.
*
* @param a the argument whose absolute value is to be determined
* @return the absolute value of the argument.
*/
+ @HotSpotIntrinsicCandidate
public static long abs(long a) {
return (a < 0) ? -a : a;
}
/**
*** 1392,1401 ****
--- 1394,1404 ----
* {@code Float.intBitsToFloat(0x7fffffff & Float.floatToRawIntBits(a))}
*
* @param a the argument whose absolute value is to be determined
* @return the absolute value of the argument.
*/
+ @HotSpotIntrinsicCandidate
public static float abs(float a) {
return (a <= 0.0F) ? 0.0F - a : a;
}
/**
< prev index next >