
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Double isInfinite Method in Java
The Double isInfinite() method returns true if this Double value is infinitely large in magnitude, false otherwise.
Let’s say we have the following Double values.
Double val1 = new Double(3/0.); Double val2 = new Double(0/0.);
Use the isInfinite() method now. The return value is a boolean.
val1.isInfinite(); val2.isInfinite();
The following is the final example.
Example
public class Demo { public static void main(String args[]) { Double val1 = new Double(3/0.); Double val2 = new Double(0/0.); System.out.println(val1.isInfinite()); System.out.println(val2.isInfinite()); } }
Output
true false
Advertisements