< prev index next >
src/java.base/share/classes/java/lang/Math.java
Print this page
@@ -1351,10 +1351,11 @@
* 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,10 +1369,11 @@
* 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,10 +1394,11 @@
* {@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 >