• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Single & double Precision

 
Greenhorn
Posts: 12
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
Sunanda
 
Ranch Hand
Posts: 1492
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
Regards,
Manfred.
 
Sunanda Kanshi
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
Sunanda
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic