On Thu, Oct 17, 2024 at 08:42:21PM +0800, Qian Yun wrote:
> BTW, why use addition for "rlb"?  The result of gcd
> will always be smaller than the arguments.
> 
> The following will save a few bytes on stack allocation.
> 
> - Qian
> 
> diff --git a/src/lisp/num_gmp.lisp b/src/lisp/num_gmp.lisp
> index f9015a2b..debcb796 100644
> --- a/src/lisp/num_gmp.lisp
> +++ b/src/lisp/num_gmp.lisp
> @@ -462,7 +462,7 @@
>           (rl (if (< xl yl) xl yl))
>           (xlb (words_to_bytes xl))
>           (ylb (words_to_bytes yl))
> -         (rlb (+ xlb ylb))
> +         (rlb (if (< xlb ylb) xlb ylb))
>          )
>          (declare (type fixnum xl yl rl xlb ylb rlb))

I do not remember why.  But gmp have its requirements, so before
going with such a change one should check what gmp requires.
Note that violating gmp requirements may work for one gmp
version and fail for different version.

-- 
                              Waldek Hebisch

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/ZxGRNbqF2VxKk7uj%40fricas.org.

Reply via email to