On 10/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> NB. The verb taking bitstrings to signed integers, (0 1 -> 1 _1):
>
> bs =: -@<:@+:
>
> NB. Its inverse verb, (1 _1 -> 0 1), is:
>
> sb =: -:@>:@-

I have not digested all of your post yet, but I thought I should note
some alternatives for these:

   bs1=: _1 ^ ]
   sb1=: bs1 inv

   sb2=: _1 ^. ]
   bs2=: sb2 inv

Of course, yours are invertible as well...

FYI,

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

Reply via email to