Mark Zellenrath escribi�:
>
> > p := 1;
> > while n <> 0 do
> > begin
> > if n mod 2 = 1 then p := p * x;
> > n := n div 2;
> > x := sqr(x);
> > end;
>
This is *VERY* inefficient,try my algorithm. X^n=exp(n*ln(x))
Bye.
--
Jorge Vidal Wulff
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Licenciatura en ciencia de la computaci�n.
Depto. de Matem�tica y ciencia de la Computaci�n.
Universidad de Santiago de Chile - USACH.
****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)
****