> (In spite of the mild put-downer > tone. ;) I didn't realize my message carried a put-downer tone. I certainly didn't intend one! But from this and the other responses it sure seems like it did. Sorry about that!
I was just trying to give they "why" in addition to the "how" (i.e. "use x:^:_1 or _1&x:") so that it would seem less arbitrary and be easier to remember [1]. But of course x: is a matter of definition, not algebra, so it is in a sense arbitrary, and I wouldn't expect anyone to just infer the answer immediately. -Dan [1] In addition to making it easier to remember _1&x:, I also thought laying out the rationale would help one reason about similar questions. For example, since we know p: N produces the Nth prime, we might expect p:^:_1 Nth-prime to produce N, and furthermore since we know p: takes a range of function codes as a LHA, we might suspect that _1&p: would have a similar effect, for mnemonic reasons. Please excuse typos; composed on a handheld device. -----Original Message----- From: Ian Clark <[email protected]> Date: Tue, 9 Mar 2010 11:24:32 To: Chat forum<[email protected]> Subject: Re: [Jchat] Conversion David speaks for me, too. (Though I *had* noticed some of them took left args.) Congrats Dan on dissecting a splendid example of "J thinking". (In spite of the mild put-downer tone. ;) I wouldn't have thought to try x:^:_1 . That's the benefit of watching the J forums. So many questions get answered which I'm going to have to ask myself sooner or later. Ian On Tue, Mar 9, 2010 at 4:38 AM, David Ward Lambert <[email protected]> wrote: > Whoops! I had ignored these primitives thinking they were merely > alternate ways to write numbers. > > j. Imaginary • Complex > o. Pi Times > r. Angle • Polar > x: Extended Precision > > > From: "Dan Bron" <[email protected]> > Subject: Re: [Jchat] Conversion > To: "'Chat forum'" <[email protected]> > Message-ID: <010901cabf1e$82032a10$86097e...@us> > Content-Type: text/plain; charset="us-ascii" > > David Ward Lambert wrote: >> I'd like to convert rational to float. What, please, is a better > way? >> 1.001 * 2r5 NB. unsatisfying. > > Since x: 2%5 converts 0.4 to 2r5 we might expect that (x:^:_1) > 2r5 would ... > > > > > > > > > > > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
