You can stop at %:y instead of -:y [: =/ ] +. >:@i.@<[EMAIL PROTECTED]:
----- Original Message ----- From: Mike Powell <[EMAIL PROTECTED]> Date: Thursday, May 17, 2007 8:16 am Subject: Re: [Jprogramming] the most impressive & beautiful J phras > Although p: and q: have taken much of the fun out of writing prime > > number algorithms, I've always liked the following for testing for > > whether a number is prime: > > [: =/ ] +. >:@i.@<[EMAIL PROTECTED]: > > (This also seems to do what you'd expect for negative arguments.) ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
