lcm([-25 30]) yielded an error after fixing #15058 69/19569/2
Samuel GOUGEON [Sat, 2 Dec 2017 17:22:20 +0000 (18:22 +0100)]
 * after https://codereview.scilab.org/19520
 * detected when using the LycĂ©e module

Change-Id: Ia4f9f9d0a74a8ab158b76b675fb6b0e694e1ffbf

scilab/modules/polynomials/macros/lcm.sci

index b7a5828..f885a55 100644 (file)
@@ -32,6 +32,8 @@ function [p, fact] = lcm(p)
         end
     end
 
+    fact = 1;
+
     // Integers:
     if type(p)==8 then
         if argn(1)==2 then
@@ -50,7 +52,6 @@ function [p, fact] = lcm(p)
     [m, n] = size(p),
     p = matrix(p, m*n, 1),
     p0 = p(1);
-    fact = 1;
     for l = 2:m*n,
         [u, v] = simp(p0, p(l)),
         p0 = p0*v,