Return | Method | Summary |
---|---|---|
static int | signum(int i) | Returns the signum. |
signum(int i) Returns
Value | Meaning |
---|---|
-1 | if i is negative; |
0 | if i is zero; |
1 | if i is positive. |
public class Main {
public static void main(String[] args) {
System.out.println(Integer.signum(10));
}
}
The output:
1
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. |