Return | Method | Summary |
---|---|---|
static int | signum(long i) | Returns the signum function of the long value. |
Returns | Meaning |
---|---|
-1 | if the specified value is negative; |
0 | if the specified value is zero; |
1 | if the specified value is positive. |
public class Main {
public static void main(String[] args) {
System.out.println(Long.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. |