Long time since I worked seriously with binary and especially packed
binaries but I seem to recall that it is all in the definition.
If it is defined as signed binary the first 0/1 tells you +/-
Published without certainty

2011/12/30 Linda Alvord <lindaalv...@verizon.net>

>   How can you tell when the leading digit is a "negative bit"  or a "binary
> digit"?
>
>  In the situation above the same number can represent two different binary
> numbers. If  1 1 0 1 is sometimes  13  or might be   _5  when is each
> appropriate?v. Isn't that the source of some problems?
>
> The spaces indicate that the number is probably a single binary number, but
> it could be a list of true and false indicators. You would need to know the
> context to determine the difference.
>
> Linda
>
> -----Original Message-----
> From: programming-boun...@jsoftware.com
> [mailto:programming-boun...@jsoftware.com] On Behalf Of Kip Murray
> Sent: Thursday, December 29, 2011 8:25 PM
> To: Programming forum
> Subject: Re: [Jprogramming] How #: should have been designed
>
>
>     tcrRaul }: i:4
> 1 0 0
> 1 0 1
> 1 1 0
> 1 1 1
> 0 0 0
> 0 0 1
> 0 1 0
> 0 1 1
>
>    tcrRandy }: i:4
> 1 1 0 0
> 1 1 0 1
> 1 1 1 0
> 1 1 1 1
> 0 0 0 0
> 0 0 0 1
> 0 0 1 0
> 0 0 1 1
>
>    tcrRaul
> {.@#:@(,: (2 * >./@,))
>
>    tcrRandy
> (0 > ]) ,"0 1 #:
>
>
> On 12/29/2011 8:41 AM, Randy MacDonald wrote:
> > On 12/8/2011 4:39 PM, Raul Miller wrote:
> >> {.@#:@(,: 2 *>./@,)i:2
> > ((0>]),"0 1#:) i:2   NB. seems to work just as well, and more obviously
> > handles the sign bit.
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Björn Helgason, Verkfræðingur
Fornustekkum II
781 Hornafirði,
t-póst: gos...@gmail.com
gsm: +3546985532
twitter: @flugfiskur
http://groups.google.com/group/J-Programming


Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans

góður kennari getur stigið á tær án þess að glansinn fari af skónum
          /|_      .-----------------------------------.
         ,'  .\  /  | Með léttri lund verður        |
     ,--'    _,'   | Dagurinn í dag                     |
    /       /       | Enn betri en gærdagurinn  |
   (   -.  |        `-----------------------------------'
   |     ) |         (\_ _/)
  (`-.  '--.)       (='.'=)   ♖♘♗♕♔♙
   `. )----'        (")_(") ☃☠
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to