Thanks Martin.. I understood the logic from ur code. But this code is not working correctly. Like, for eg for a value of 4.0 the converted value is 2.0. I tried the sample in c++ and jave and found this problem. The bits value is correct in both the cases. So the problem is only because of longBitsToDouble I think.. Can u help me in correcting this problem?
 
Regards,
ishwari
 
----- Original Message -----
Sent: Monday, July 09, 2001 4:07 PM
Subject: Re: [JAVA3D] Need of Equivalent code in Java

Hi Ishwari
 
You may try that:
 
long bits=0;
for (int i=0; i<8; i++)
{
    bits = (bits << 8) | getByte();
}
double value = Double.longBitsToDouble(bits);
 
 
    Martin.
 
 
 
----- Message d'origine -----
De : ishwari
Envoyé : lundi 9 juillet 2001 04:23
Objet : Need of Equivalent code in Java

Hi,
 
I have the follg code in c++. I wish to have the equivalent code in Java.. Can anyone help me in getting it??
 
 
c++ code:
 
BYTE arr[8];
double *dbptr;
 
for(i=0;i<8;i++)
    arr[i] = getbyte();
 
dbptr = (double *)arr;
 
 
Thanks in advance,
 
Regards,
ishwari
 

Reply via email to