Java Number Sign signum(long number)

Here you can find the source of signum(long number)

Description

signum

License

Apache License

Declaration

public static int signum(long number) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static int signum(long number) {
        if (number < 0)
            return -1;
        else if (number == 0)
            return 0;
        else/*from www. j av  a 2s.c o  m*/
            return 1;
    }

    public static int signum(double d) {
        return (int) Math.signum(d);
    }
}

Related

  1. signum(float val)
  2. signum(int a)
  3. signum(int v)
  4. signum(long diff)
  5. signum(long l)
  6. signumEps(double val, double eps)