Java StrictMath.signum(float f)

Syntax

StrictMath.signum(float f) has the following syntax.

public static float signum(float f)

Example

In the following code shows how to use StrictMath.signum(float f) method.


/*from   w w  w. j  a  va 2s  .c om*/
public class Main {

  public static void main(String[] args) {
  
    float f1 = 123.45f, f2 = 0.0f, f3 = -0.0f;

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

    System.out.println(StrictMath.signum(f2));
    
    System.out.println(StrictMath.signum(f3)); 
  }
}

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