[Scilab-users] lcm() output type: how to avoid overflowing and get an actual result?

Samuel Gougeon sgougeon at free.fr
Wed Mar 15 20:44:33 CET 2017


Hello Tim,

Le 15/03/2017 à 18:57, Tim Wescott a écrit :
> So, a quick test gives me:
>
> -->A = uint8([123 423]); A / lcm(A)
>   ans  =
>   
>    2  2
>
> This looks pretty "least common multiple" to me.

Really? In which way?
As long as integers are used, the result should not depend on their 
encoding. So:

--> A = [123 423]; Lcm = lcm([123 423]), Lcm ./ A
  Lcm  =
   17343

  ans  =
   141  41

BTW, why are you computing A/Lcm instead of Lcm ./A ?




More information about the users mailing list