LCM: Least Common Multiplier
Peter da Silva
peter at ficc.ferranti.com
Fri Jul 13 00:01:49 AEST 1990
In article <1990Jul12.004600.7378 at Neon.Stanford.EDU> michaelg at Neon.Stanford.EDU (Michael Greenwald) writes:
> x2 = lcm (numbers[--n], n, numbers);
Not a good idea. N might be decremented before or after the second use, even
in pre-ANSI compilers. Try:
n--;
x2 = lcm(numbers[n], n, numbers);
--
Peter da Silva. `-_-'
+1 713 274 5180.
<peter at ficc.ferranti.com>
More information about the Comp.unix.questions
mailing list