- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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
- Related Articles
- Overflow of DataTypes in Java
- Java overflow and underflow
- Display the limits of DataTypes in Java
- Display default initial values of DataTypes in Java
- How can we check an underflow occurs in Java?
- Python Container Datatypes
- Range Overflow and Range Underflow properties in JavaScript.
- Python – Get the datatypes of columns
- What is the C# Equivalent of SQL Server DataTypes?
- Python - Select columns with specific datatypes
- Difference between Primitive and non-primitive datatypes in JavaScript?
- C++ Program to check if tank will overflow, underflow or filled in given time
- Write a program to get the list of all the supported datatypes in JDBC?
- Python Pandas - Form the Union of two Index objects with different datatypes
- What is the difference between BLOB and CLOB datatypes?

Advertisements