Java Number Sign signum(long l)

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

Description

signum

License

Open Source License

Declaration

public static int signum(long l) 

Method Source Code

//package com.java2s;

public class Main {
    public static int signum(long l) {
        if (l > 0) {
            return 1;
        } else if (l < 0) {
            return -1;
        } else {// w w  w  . ja  va  2  s .c om
            return 0;
        }
    }

    public static int signum(double l) {
        if (l > 0) {
            return 1;
        } else if (l < 0) {
            return -1;
        } else {
            return 0;
        }
    }
}

Related

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