java.lang.Math.signum(double d)


java.lang.Math.signum(double d)

package com.codingdict;



import java.lang.*;



public class MathDemo {



   public static void main(String[] args) {



      // get two double numbers

      double x = 50.14;

      double y = -4;



      // call signum for both doubles and print the result

      System.out.println("Math.signum(" + x + ")=" + Math.signum(x));

      System.out.println("Math.signum(" + y + ")=" + Math.signum(y));

   }

}