70
Java Double isInfinite() method
The isInfinite() method of Java Double class will return true if the magnitude of the argument specified is infinitely large, else it will return false.
Syntax
Parameters
1.NA
2.v- This is the double value which is tested.
Return value
The isInfnite() method returns true if the value of argument passed is positive/negative infinity, otherwise returns false.
Example 1
Output:
Infinity value for isInfinite() method is : true Infinity value for isFinite() method is : false
Example 2
Output:
1. 2.13909504E9 value = false 2. 7.6E-42 value = false 3. NaN value = false 4. -Infinity value = true
Example 3
Output:
1. 7.643476374682469E10 value = false 2. 27.827 value = false 3. Infinity value = true 4. -Infinity value = true 5. NaN value = false
Next TopicJava Double