package javaapplication1;
public class JavaApplication1 {
public static void main(String[] args) {
double d1 = 3.14;
double d2 = -1.87;
double d3 = 0;
double d4 = -0;
// signum(double d)
System.out.println("Math.signum(" + d1 + ") = " + Math.signum(d1));
System.out.println("Math.signum(" + d2 + ") = " + Math.signum(d2));
System.out.println("Math.signum(" + d3 + ") = " + Math.signum(d3));
System.out.println("Math.signum(" + d4 + ") = " + Math.signum(d4));
}
}
/*
run:
Math.signum(3.14) = 1.0
Math.signum(-1.87) = -1.0
Math.signum(0.0) = 0.0
Math.signum(0.0) = 0.0
*/