1 /* It makes the linear solver non-verbose */
4 /* Necessary to use "lcm" */
7 /* Fix for the wrong redefinition of "evenp" and "oddp" */
8 /* introduced in Maxima 5.9.3-3 */
9 /* evenp(i) := is(mod(i,2)=0); */
10 /* oddp(i) := is(mod(i,2)=1); */
13 lcm(a,b) := ratexpand(a*b/gcd(a,b));
17 if length(lst) = 1 then
20 if length(lst) = 2 then
21 pair_gcd(lst[1],lst[2])
23 lst_gcd(cons(pair_gcd(lst[1],lst[2]),rest(lst,2)));
25 pair_gcd(lhs,rhs) := gcd(lhs,rhs); /* just to avoid name conflicts */
27 pair_lcm(lhs,rhs) := ratexpand((lhs*rhs)/pair_gcd(lhs,rhs));
31 if length(lst) = 1 then
34 if length(lst) = 2 then
35 pair_lcm(lst[1],lst[2])
37 lst_lcm(cons(pair_lcm(lst[1],lst[2]),rest(lst,2)));
39 lcm([lst]) := lst_lcm(lst);
41 sarag_lcm([lst]) := lst_lcm(lst);