Java Float.isInfinite(float v)

Syntax

Float.isInfinite(float v) has the following syntax.

public static boolean isInfinite(float v)

Example

In the following code shows how to use Float.isInfinite(float v) method.


public class Main {
// ww  w  .  j a v a 2  s  . co  m
   public static void main(String[] args) {

     Float f1 = new Float(1.0/0.0);
     Float f2 = new Float(0.0/0.0);
  
     System.out.println(f1 + " = " + Float.isInfinite(f1));
     System.out.println(f2 + " = " + Float.isInfinite(f2));
   }
}

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