2^44 is going to be floating-point, which will do its
thing regardless of how big your integers are.  Try
2x^44.

I don't have a 64-bit system to test on.

Henry Rich 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of david alis
> Sent: Monday, May 28, 2007 11:39 AM
> To: Programming forum
> Subject: [Jprogramming] 64bit integers vs 32bit integers
> 
> Consider the expression
> foo=: 3 : 'assert. *./#:<:2^y'
> The smallest argument value which triggers the assertion 
> failure is 44.
> This value is the same on both 32bit J (windows xp) and 64bit 
> J (Ubuntu 7.04).
> (Aside: the expression #:<:2^N is the binary representation of _1 +
> 2^N, which, from the point of view of the language, must always be a
> sequence of 1's)
> 
> I am puzzled by this result because in J-64 integers are indeed
> represented with 8bytes as can be demonstrated by:
> abcd =. 1000?1000
> 7!:5<'abcd'  returns
> 4096  -- with 32bit J
> 8192  -- with 64 bit J
> 
> It is the difference in behaviour of the binary primitives between
> 32bit and 64bit that led me to believe that domain of precise
> arithmetic with integers would be greater in J64 than in J32.
> For example:
> 1   (17 b.)2^40
> throws a domain error on 32bit J but returns 0 on 64bit J.
> 
> Can someone explain?
> 
> Regards
> David
> ----------------------------------------------------------------------
> For information about J forums see 
> http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to