[Jprogramming] Truncating
Roger Hui
rhui000 at shaw.ca
Mon Mar 5 23:51:13 HKT 2007
The point is not the number of characters but a
pattern that is useful in other areas. In this case
the pattern is duality. For other examples of
duality, please see:
http://www.jsoftware.com/jwiki/Essays/Under
----- Original Message -----
From: Geoff Canyon <geoffc at inspiredlogic.com>
Date: Sunday, March 4, 2007 10:04 pm
Subject: Re: [Jprogramming] Truncating
> Wow -- that's great stuff. I tried it, and it worked a treat. If I
>
> understand correctly, the &. command joins the i. and the
> (p:^:_1),
> which is the inverse of p:. So this command says: apply the
> inverse
> of the prime function to 10000 to find what the order of that
> prime
> is, then iterate up to that number, then get the primes up to that
>
> index. I'm curious -- how is the use of &. better than just
> writing
> out what is needed. As far as I can see these are equivalent:
>
> i.&.(p:^:_1)10000
> p:i.(p:^:_1)10000
>
> They take the same number of characters to type, so why is the
> former
> preferred to the latter?
>
> regards,
>
> Geoff
>
> On Mar 4, 2007, at 12:42 AM, Raul Miller wrote:
>
> > On 3/4/07, Geoff Canyon <geoffc at inspiredlogic.com> wrote:
> >> based on a calculation? For example, suppose I want to generate all
> >> the primes < 10,000.
> >
> > i.&.(p:^:_1)10000
More information about the Programming
mailing list