Subject: Re: handling small numbers (fwd)

From: Jan Wielemaker <[email-masked]>
Date: Fri, 5 May 2000 13:21:02 +0200

> gcd( M, N, C ) :-
>         ( N =:= 0 -> C is M
>                   ;  NewN is M mod N,
>                      gcd( N, NewN, C )
>         ).

This little program will benefit a lot from pl-3.3.6 and using -O.
3.3.6 has a much better implementation of if -> then ; else and -O
optimises arithmetic to compile to a stack-engine instead of the
default: building the expression and evaluating it by is/2 (problem
is to can't trace optimised arithmetic as noting is `called').

Op course you can also write it in C.  It is a trivial exercise.

	Regards --- Jan

P.s.	For all you number crunchers, you might have a look at the
	mp package for SWI-Prolog.