 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP 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
Underflow of DataTypes in Java
Underflow occurs when the given value is less than the maximum prescribed size of a data type. The underflow condition can result to an error or now the implementation of the programming language handles it on its own.
To display underflow of datatypes, I have taken an example of double datatype. Double data type is a single-precision 64-bit IEEE 754 floating point.
The following program display underflow of datatype in Java.
Example
public class Demo {    public static void main(String[] args) {       System.out.println("Displaying Underflow... ");       double val1 = 3.2187E-320;       System.out.println(val1/1000000);    } }  Output
Displaying Underflow... 0.0
In the above program, the double variable is initialized to.
double val1 = 3.2187E-320;
After that, division operation is performed on it to check for underflow.
val1/1000000
It returns the following.
0.0
Advertisements
 