Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

how to convert double to byte[] openvms format?

Thread view: 
troy@makaro.com - 31 Dec 2005 00:34 GMT
Hi, I am trying to figure out how to convert a double in java to an
array of 8 bytes that is compatible with openvms alpha programs. It's
more complicated than a big endian/little endian issue. Any ideas?

A double on openvms of '3495.0' has the following 8 bytes:
90 70 0 112 0 0 0 0 (openVMS Basic program was used to get the bytes)

A GFloat on openvms of '3495.0' has the following 8 bytes:
-53 64 0 78 0 0 0 0 (openVMS Basic program was used to get the bytes)

A double in java of '3495' has the following 8 bytes:
64 -85 78 0 0 0 0 0

Note that I can convert the double in java to a gfloat by doing a big
endian/little endian swap and adding 32 to the second byte.
castillo.bryan@gmail.com - 02 Jan 2006 05:26 GMT
Take a look at this page.

http://h71000.www7.hp.com/commercial/basic/basic_doc/bas_um_028.htm
Roedy Green - 02 Jan 2006 14:48 GMT
>Hi, I am trying to figure out how to convert a double in java to an
>array of 8 bytes that is compatible with openvms alpha programs. It's
[quoted text clipped - 11 lines]
>Note that I can convert the double in java to a gfloat by doing a big
>endian/little endian swap and adding 32 to the second byte.

This will be much easier if you find documentation on the openvms
floating point format.  Once you get it in it is a matter of
extracting bits, changing offsets and packing them together again.

If that is impossible to find, try looking at the formats for numbers
like
0 1 .5 .75 etc until you gradually piece together what the bits are
for.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Jim Korman - 02 Jan 2006 15:59 GMT
<snip>
>This will be much easier if you find documentation on the openvms
>floating point format.  Once you get it in it is a matter of
[quoted text clipped - 4 lines]
>0 1 .5 .75 etc until you gradually piece together what the bits are
>for.

Goggling ["OpenVMS double binary format"] gets

http://h71000.www7.hp.com/commercial/basic/basic_doc/bas_um_028.htm

Appears to be what you're looking for.

Jim


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.