wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes range of float and double Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "range of float and double" Watch "range of float and double" New topic
Author

range of float and double

Sanjay Mishra
Ranch Hand

Joined: Jul 08, 2000
Posts: 84
Is it positive infinity to negative infinity?
Than how can it fit in into 32 bit and 64
bits?
deekasha gunwant
Ranch Hand

Joined: May 06, 2000
Posts: 396
Hi sanjay,
range of Float and double can be found by running the following program.
--------------------------------------------------------
class MaxMin
{
public static void main(String j[])
{
System.out.println("Max Float :"+Float.MAX_VALUE);
System.out.println("Min Float :"+Float.MIN_VALUE);
System.out.println("Max Double :"+Double.MAX_VALUE);
System.out.println("Min Double :"+Double.MIN_VALUE);
}
}
--------------------------------------------------------
Now POSITIVE_INFINITY and NEGATIVE_INFINITY are two constants defined by Float and double classes which are used to handle overflow and underflow conditions.as soon as it seems that the value assigned to float /double is going to be greater than MAX_VALUE or less than MIN_VALUE then java uses two infinity constants and neatly saves us from an exception.
regards
deekasha
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: range of float and double
 
Similar Threads
LIMITS OF SOFTWARE
We won!
Division by zero double
WA #1.....word association
ID:6 SCJP Question of the day : Saturday June 12 2010