Online Java Compiler By
JavaTpoint.com
public class IntegerSignumExample3 { public static void main(String[] args) { double nan = Double.NaN; // Here argument is NaN, output will be NaN double result1 = Math.signum(nan); System.out.println("Output: "+result1); // Here argument is positive zero double result2 = Math.signum(0); System.out.println("Output: "+result2); // Here argument is negative zero double result3 = Math.signum(-0); System.out.println("Output: "+result3); } }
Output