473,394 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

(2+4) 6 byte integer to double

There is a DLL on a Windows (Intel, 32-bit) server that contains a functions called EntConvertInt which takes a Int16 and Int32 arguments and returns a double.

I want to create a Java version of this, but cannot get the numbers to work.

I think the Int16 is the exponent (including the sign bi) and the Int32 is the mantissa.

I think what the DLL does is convert the ints to binary or Hex, and then moves the two to a double.

Example of inputs and expected results are:

Int16 Int32 Result
129 0 1
138 369098752 600
29069 379652669 4820.13

I tried converting the inputs to binary (Integer.ParseInt ( x, 2 )),
then joining to two into a string and then using Double.logbitstodouble, but the result is way out.

I have tried a number of combinations of adjusting taking the 48-bit binary "string" and then adjusting the size of the exp/mantissa to see which combination gives the right answer but to no avail.

I need some pointers on how this can be done in Java as I am all out of ideas.
Oct 20 '11 #1
0 1640

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: | last post by:
When I execute the following (with an OleDBDataAdapter), wanting to add a row to a visual foxpro table: myrow= datasetTarget.Tables(0).NewRow 'fill all columns here like.. row(i)= myvalue '...
9
by: mprocopio | last post by:
Fellow JavaScripters, I am looking for code or implementation ideas for converting an integer variable to a four-byte array. I'm porting some of my code from C#, where I make use of their...
22
by: bq | last post by:
Hello, Two questions related to floating point support: What C compilers for the wintel (MS Windows + x86) platform are C99 compliant as far as <math.h> and <tgmath.h> are concerned? What...
9
by: sudi | last post by:
HI, I face the task of converting a 6 byte integer (MSB first) to a decimal string. The platform I use supports only 4 byte basic data type. I have written some algorithms that loops to many...
3
by: RoSsIaCrIiLoIA | last post by:
I have rewrote the malloc() function of K&R2 chapter 8.7 typedef long Align; ^^^^ Here, should I write 'long', 'double' or 'long double'? I know that in my pc+compiler sizeof(long)=4,...
14
by: cj | last post by:
VB2003. I need a large positive integer. Which is larger int64 or double? I see int64 also apparently is known as long and will hold -9,223,372,036,854,775,808 through...
3
by: Imayam | last post by:
Hi .! This is my first post to this community..! I am trying to use 64 bit data in 16 Bit dos.Here i have a Borland C 3.1 Compiler in which i have data types int = 2 byte long = 4 byte...
8
by: Polaris431 | last post by:
I have a buffer that holds characters. Four characters in a row represent an unsigned 32 bit value. I want to convert these characters to a 32 bit value. For example: char buffer; buffer =...
0
by: alanwo | last post by:
Hi Experts, Interesting finding, when comparing two dictionary of byte(), KeyNotFoundException throwed but, that byte() key is present in another dictionary. Is that the limitation of comparison...
3
by: Paul D Ainsworth | last post by:
Greetings everyone. I'm a relative newcomer to python and I have a technical problem. I want to split a 32 bit / 4 byte unsigned integer into 4 separate byte variables according to the following...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.