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 Single & double Precision 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 "Single & double Precision" Watch "Single & double Precision" New topic

Single & double Precision

Sunanda Kanshi

Joined: Dec 26, 2000
Posts: 12
Hello friends,
I am confused about the single and double precision in Java.What they are used for and what's the difference between them.If anyone can tell me,i will be very thankful.
Thanks in advance.
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi, Sunanda!
The single and double precision refer to the IEEE 754-1985 standard. For Java the following is true:
single prec -> 32 bits -> Min = 1.43e-45 -> Max = 3.4e38
Double prec -> 64 bits -> Min = 4.942-324 -> Max = 1.8e308
As you can see, double precision can hold much larger values then the single precision. You also use double the amount of memory for double versus single.
Sunanda Kanshi

Joined: Dec 26, 2000
Posts: 12
Thanks for the description,but there is one more doubt,what about the decimal places in both ,the single and double precision.
Thanks in advance.
It is sorta covered in the JavaRanch Style Guide.
subject: Single & double Precision
Similar Threads
Single and double precision numbers...
Single precision /double precision?
whats the difference between float & double
What is Single and Double precision
Not Getting Compilation Error?