Conditional inside a block not working



On Sunday 13 April 2008 19:34, Bill Wood wrote:
> OK, I'm officially confused here.  I am trying to write a function that
> runs though a sequence of integers until an interesting value occurs, at
> which point the interesting value is returned.  Here is the function I
> wrote:
>
>   (%i10) foo(bound) := block([m],
>                              for m: 286 step 1 thru bound do
>                                (if
> is(equal(23624910,power_mod(m,3,25084897)))
>                               then return(m)),
>                            return(0));

"return(m)" returns from a "for" block and then "return(0)" is executed.

-- 
Alexey Beshenov <al at beshenov.ru>
http://beshenov.ru/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20080413/7b825705/attachment.pgp