This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 9044
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
Don't get me started about those stupid light bulbs.
subject: Floating-point numbers range
Similar Threads
Jobs in Germany
range of char
Javascript error in range validation
integer range
Access/VBA developer in Connecticut re-posted on 07-May-2003