File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

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

Joined: Jul 22, 2000
Posts: 9059
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
(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.

"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
I agree. Here's the link:
subject: Floating-point numbers range
jQuery in Action, 3rd edition