The dyad   m&|@^   is apparently implemented by special
code even when the arguments are not extended precision.
Appendix B of the dictionary will be corrected in this regard.

For example, the last 9 digits of 2^2e9 :

   2 (1e9&|@^) 2e9
787109376
   2x ((10^9x)&|@^) 2x*10^9x
787109376

Of course, if the arguments are extended precision you can
do more.  e.g. The last 9 digits of  2^2^10000  :

   2 (1e9&|@^) 2^10000x 
617627136



----- Original Message -----
From: Raul Miller <[EMAIL PROTECTED]>
Date: Tuesday, September 16, 2008 6:01
Subject: Re: [Jprogramming] pseudo-random sequence
To: Programming forum <[email protected]>

> On Tue, Sep 16, 2008 at 8:54 AM, I wrote:
> > Here's one approach:
> >   U=: 64007| (? 64007) * 15091(64007&|)@^ i. 4000
> 
> Um... I forgot to check if there was any special code for
> (m&|)@^ and it appears that there is not, so this might
> have some rounding errors.
> 
> I also used 4000 instead of 40000.
> 
> Anyways, here's a valid approach:
>    U=: (64007 | [ * >:)^:(i.40000) ?64007
> 
> This is a bit slower, but getting the wrong answer fast
> is often a bad idea.
> 
> (I should also note that some other posts in this thread
> also appear to have given me incorrect answers.)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to