I don't know if your original post had a typo, but it reported 1 0 1.

but how about this

    ( ''"_`(_1:)@.(_1 = *) , #:) _3
_1 0 1

     #: inv _1 0 1
_3





----- Original Message -----
From: Raul Miller <[email protected]>
To: Programming forum <[email protected]>
Cc: 
Sent: Thursday, November 12, 2015 4:50 PM
Subject: Re: [Jprogramming] twos complement

On Thu, Nov 12, 2015 at 12:45 PM, 'Pascal Jasmin' via Programming
<[email protected]> wrote:
> Your version creates an encoding of _3 that is identical to 5.  Which might 
> be a problem when inverting.

I disagree.

   sbits _3 5
1 1 0 1
0 1 0 1

The first bit is 1 for negative integers and 0 for positive integers.


Thanks,

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