Re: LCM for TI-92
[Prev][Next][Index][Thread]
Re: LCM for TI-92
On Tue, 17 Mar 1998 00:02:40 -0700, in you wrote:
> On the TI-92: Is there some way to make it find the LCM (least
>common multiple for more that just two numbers?)
>
>Thor
IF the following is true:
lcm(x,y,z) = lcm(lcm(x,y),z)
[please prove that, I am too lazy]
You can use the following useful function:
lstmap(fstr,lst)
Func
Local acc, i
lst[1]->acc
For i,2,dim(lst)
#fstr(acc,lst[i])->acc
EndFor
Return acc
EndFunc
For example:
Define lstlcm(list)=lstmap("lcm",list)
Define lstgcd(list)=lstgcd("gcd",list)
lstlcm({10,20,5}) = 20
lstlcm({2^2*3,2^2*3^3,2*7}) = 756 = 2^2*3^3*7
--
Roberto Lupi
Electronic Engineering Student - University of Ancona - Italy
Linux/NT System Administrator
Linux/Win32 Developer
Follow-Ups: