File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Floating-point numbers range Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Floating-point numbers range" Watch "Floating-point numbers range" New topic
Author

Floating-point numbers range

Otto Deckelman
Ranch Hand

Joined: Mar 28, 2001
Posts: 30
Can someone explain what the range of a float actually means.
example: 1.4E-45 to 3.4E+38
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9053
    
  12
1.4E-45 means
1.4*10^-45 (E stands for "exponent")
(i.e. 0.000000000000000000000000000000000000000000014)

This is the smallest possible positive float number

3.4E+38 means
3.4*10^38
(i.e. 340,000,000,000,000,000,000,000,000,000,000,000,000)

This represents the largest possible postive float number.

Remember that there are also negative float numbers.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Otto Deckelman
Ranch Hand

Joined: Mar 28, 2001
Posts: 30
Marilyn, thanks alot...your explanation really helps
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Floating-point numbers range