Java StrictMath.signum(double d)

Syntax

StrictMath.signum(double d) has the following syntax.

public static double signum(double d)

Example

In the following code shows how to use StrictMath.signum(double d) method.


/*from w w w  .j av  a  2 s. c  om*/

public class Main {

  public static void main(String[] args) {
  
    double d1 = 123.45d, d2 = 0.0d, d3 = -0.0d;

    System.out.println(StrictMath.signum(d1));

    System.out.println(StrictMath.signum(d2));
    
    System.out.println(StrictMath.signum(d3));
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable