[Jprogramming] 64/32 bit issue with JDLLServer .NET

seb_foren at arcor.de seb_foren at arcor.de
Mon Aug 18 12:16:06 UTC 2014


I have an issue with the 64-bit JDLLServer in relation to 64 integers. 
It seems that JDLLServer handles only the lower 32 bits of a 64 bit 
value. The following test demonstrates this issue:

Test (C#):
var value = 1000 + ((Int64)1 << 32);
_j.Do(String.Format("a =: {0}", value));
Assert.AreEqual(value, _j.GetB("a"));

Results:
Assert.AreEqual failed. Expected:<4294968296 (System.Int64)>. 
Actual:<1000 (System.Int32)>.


There is a similar problem to getting int arrays. The following test 
fails:

_j.Do("a =: 10 20 30");

var a = (int[])_j.GetB("a");
Assert.AreEqual(10, a[0]);
Assert.AreEqual(20, a[1]);
Assert.AreEqual(30, a[2]);

The result of 'a' is not '10 20 30', but '10 0 20'. I guess, '0' stands 
for the higher 32 bits of the whole value '10 0'.

What can I do to resolve these issues?
I can not switch to the 32 bit J version, because I work with JD, that 
requires a 64 bit J.
My current workaround is avoiding integers and only work with floats, 
but this is not a real solution.

Any Ideas?

PS: Sorry for my English :)



More information about the Programming mailing list