[Jprogramming] Re: A stunning (to me) revelation about J (G. Canyon)

Roy A. Crabtree roy.crabtree at gmail.com
Tue Jun 5 00:01:10 HKT 2007


The basic kvecth is:  Can radix encoding be defined to be completely
consistent outside the
radix numbers (I >1) with _all_ of the properties the same?

Since it cannot, the kvetch is:  what is the best alternative to be chosen?

I think that (as usual) J's implementors and designers have come up with a
pretty good pick.

(Even if I now or later find fluff to pick off it, as I usually do).

((Because: that is in the nature of language design: things and opinions
change and differ)).

On 6/4/07, Oleg Kobchenko <olegykj at yahoo.com> wrote:
>
> Base representation is also done with #. and #:
>
> But the inverse of #. and antibase #: don't work
> as expected:
>
>    0.1 #. 1 2 3
> 3.21
>    0.1 #.^:_1] 3.21
>
>    0.1 0.1 0.1 #: 3.21
> 0 0 0.01
>    0.1 0.1 0.1 #. 0 0 0.01
> 0.01
>
>    _3 #. 1 2 0 2
> _7
>    _3 #.^:_1] _7
> _1 _1
>    _3 _3 _3 _3 #: _7
> 0 _1 _1 _1
>    _3 _3 _3 _3 #. 0 _1 _1 _1
> _7
>
>
> --- Arved Sandstrom <asandstrom at accesswave.ca> wrote:
>
> > It's probably not as remarkable as it sounds. :-) The most basic
> operation -
> > that of doing _3b1202, or suchlike - will happen correctly even if the
> > implementor only ever thinks of positive bases.
> >
> > You may have noted too that using a negative base in J will accommodate
> a
> > negative representation, as in _3b_121 = _4, and I do not believe that
> this
> > is conventional. If it was accepted it should probably mean
> >
> > +/ 9 _3 1 * _1 2 1 = _14
> >
> > anyway. But that is maybe leaving up to the user not to be stupid; for
> > example in J601 you can do 2b222, and _5b879.
> >
> > Arved Sandstrom
> >
> > [ SNIP ]
> > > Then I thought back to a math competition I was once in, where they
> > > first had a speaker talk about a subject that the competitors
> > > presumably had never been exposed to before, and then had us take a
> > > test on the subject.
> > >
> > > The subject of the talk was negative bases. For example base negative
> > > 3, where 120 is equal to
> > >
> > > 1*(-3)^2 + 2*(-3)^1 + 0*(-3)^0 = 3
> > >
> > > As an aside, one interesting aspect of negative bases is that you
> > > never need to negate a number. For example, -7 = 1202.
> > >
> > > So having discovered that J seemingly handles arbitrary bases, I
> > > tried negative bases, and sure enough, it works:
> > >
> > >    _3b1202
> > > _7
> > >
> > > _That_ was a pleasant surprise!
> > >
> > > regards,
> > >
> > > Geoff
> >
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
>
>
>
>
>
> ____________________________________________________________________________________
> Be a better Heartthrob. Get better relationship answers from someone who
> knows. Yahoo! Answers - Check it out.
> http://answers.yahoo.com/dir/?link=list&sid=396545433
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Use Reply-To: & thread your email
after the first: or it may take a while, as
I get 2000 emails per day.
--

Roy A. Crabtree
UNC '76 gaa.lifer#
(For TN contact, email me to set up a confirmed date/time)

[When you hear/read/see/feel what a yehudi plays/writes/sculpts/holds]
[(n)either violinist {Menuhin} (n)or writer {"The Yehudi Principle"} (n)or
molder (n)or older]
[you must strive/think/look/sense all of it, or you will miss the meanings
of it all]

roy.crabtree at alumni.unc.edu Forwards only to:
roy.crabtree at gmail.com CC: auto to:
3363401304 at messaging.sprintpcs.com Be short < 160 chars cuts off; currently
offline
crabtreeroya at yahoo.com CC: auto to ^

http://www.authorsden.com/royacrabtree
http://skyscraper.fortunecity.com/activex/720/resume/full.doc
--
(c) RAC/IP, ARE,PRO,PAST
(Copyright) Roy Andrew Crabtree/In Perpetuity
    All Rights/Reserved Explicitly
    Public Reuse Only
    Profits Always Safe Traded


More information about the Programming mailing list