Return | Method | Summary |
---|---|---|
static double | abs(double a) | Returns the absolute value of a double value. |
static float | abs(float a) | Returns the absolute value of a float value. |
static int | abs(int a) | Returns the absolute value of an int value. |
static long | abs(long a) | Returns the absolute value of a long value. |
public class Main {
public static void main(String[] args) {
System.out.print(Math.abs(-1.23));
}
}
The output:
1.23
java2s.com | Contact Us | Privacy Policy |
Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
All other trademarks are property of their respective owners. |