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 Double precision floating point Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Double precision floating point" Watch "Double precision floating point" New topic
Author

Double precision floating point

John Ryan
Ranch Hand

Joined: Mar 14, 2001
Posts: 124
Hi everyone,
The byte data type represents 8 bit integers that range from -128 to 127.
The double precision floating point data type has 64 bits. The first is the sign bit.The next 8 bits hold the exponent and the final 55 bits hold the mantissa. If the exponent is only 8 bits does this mean that the number before the decimal place can only be between -128 and 127. Im sure it can be larger but i dont understand why??
Thanks,
john
Michael Fitzmaurice
Ranch Hand

Joined: Aug 22, 2001
Posts: 168
Hi John
You seem to be confusing the way that the number is held in memory with the way that it appears on the screen. The mantissa and exponent are not the portions of the number before and after the decimal point. The following article should shed some light on this:
http://www.javaworld.com/javaworld/jw-10-1996/jw-10-hood.html
Hope this helps
Michael
------------------
"One good thing about music - when it hits, you feel no pain"
Bob Marley


"One good thing about music - when it hits, you feel no pain" <P>Bob Marley
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
John
Actually your pretty close to the actual values it can be. For the whole ugly description check out the JLS Section 4.2.3 .
For the normal 64 bit float it looks like the exponent can be in the range -149 to +104. My interpretation may be off though
hope that helps

------------------
Dave
Sun Certified Programmer for the Java� 2 Platform


Dave
John Ryan
Ranch Hand

Joined: Mar 14, 2001
Posts: 124
Cheers guys, some reading for tonight
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Double precision floating point
 
Similar Threads
Integer.MAX_VALUE
signed bits...
method parameter question
Long.MAX_VALUE and double conversion
why can a long assigned to float without casting