> Similarly, I’d expect bw to be used to manipulate the *machine integers* 
> underlying extended J integers, not the highly-abstract J extended integers 
> themselves.

~: bw bw is ~:.  That is cool, but I'm not sure of the benefit of typing 22 bw 
instead of just ~:.

Is the format for extended integers documented anywhere.  Playing around with 
3!:3 shows that its an array of 16bit values. (possibly a * optimization).

There is a quite a few nice things about working with extended integers:  There 
is a range of numbers from 31 to 62 bit that must be extended on 32 bit 
platforms but may not be on 64bit.  If you are using extended integers its nice 
to stay in that mode, though interestingly:

256 #. inv NB.is 10 times faster than 
65536 #. inv NB. which is 100 times slower than
3!:1 

#: (base2) is 5 times slower than 256#. inv

but I don't know how to process the elements part of 3!:1 to get back the 
original number.




----- Original Message -----
From: Dan Bron <[email protected]>
To: J Programming <[email protected]>
Cc: 
Sent: Thursday, August 13, 2015 3:10 PM
Subject: Re: [Jprogramming] Bitwise operations utility

Pascal wrote:
> |.!.0 NB. unsigned
> |.!.1 NB. signed

Ah, this is helpful. Thanks.  These definitions will allow me to simplify some 
of the normalization functions.

> signed_shift is undefined,

That’s because I didn’t know how to define it, until now ;)

> an extra that would be cool is versions that work
> with extended integers.


The primary use case here is to manipulate memory and low-abstraction objects.  
For example:

       1: bw 12345 
    _1

Makes sense from a machine integer level, but not on a J level.  Similarly, I’d 
expect bw to be used to manipulate the *machine integers* underlying extended J 
integers, not the highly-abstract J extended integers themselves.


-Dan

----------------------------------------------------------------------
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