[omniORB] What the difference betwen long & double

Boris Khanales boris@imagine-sw.com
ue, 7 Jul 1998 14:05:38 -0400


> In Message <98Jul7.121037edt.11651-1@gateway.imagine-sw.com> ,
>    boris@imagine-sw.com (Boris Khanales) wrote:
> 
> =>I have kind of complex data structure:
> =>
> =>
> =>
> =>
> =>foo.idl
> =>
> =>struct Foo
> =>{
> =>sequence<any> data;
> =>};
> =>
> =>interface Hoo
> =>{
> =>long method( in Foo f );
> =>}
> =>
> =>
> =>The client does something like this:
> =>
> =>Foo f;
> =>f.data.length(1);
> =>
> =>Foo f2;
> =>f2.data.length(1);
> =>
> =>// Attn !!!
> =>if I do this:
> =>f2.data[0] <<= 1L; Everithing OK
> =>
> =>BUT
> =>f2.data[0] <<= 1.1; It does not work!!!
> =>
> =>f.data[0] <<= f2;
> =>
> =>
> =>
> =>Any ideas?
> =>HELPPP!?!?!
> =>
> 
>    Try "f2.data[0] <<= CORBA::Double(1.1);". It needs either a
> CORBA::Double or a CORBA::Float, both of which are defined as classes
> in OmniORB. It may be getting confused over which conversion to make,
> so making it explicit could fix the problem.
> 
> 					Gary Duzan
> 					GTE Laboratories
> 
> 
> 
Does not work. I tried sensless thingth like
 <<= *(new double( tmpDouble))
 and CORBA::Double
 same result.
 
 What is realy surprise me that I have a case
 when I do this
 
 Any a1 <<= 1L;
 Any a2 <<= 1.1;
 
 f2.data[0] = a2; // exception
 
 f2.data[0]  <<= a2; // Sends message, but on recieve side
	f2.data[0]   has _tc_any type
	
	
Any difference between long &  double?
I've notice float & double are the special case.
There is a macro HAS_DOUBLE, but ...