[R] Greatest common divisor of two numbers

2007-04-17 Thread AbouEl-Makarim Aboueissa
Dear Sir/Madam: Could you please let me know which function shall I use to get the Greatest common divisor of two numbers. Thank you so much for your attention to this matter, and i look forward to hear from you soon. Regards; Abou == AbouEl-Makarim Aboueissa, Ph.D.

Re: [R] Greatest common divisor of two numbers

2007-04-17 Thread Patrick Burns
S Poetry has a function for that. Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and A Guide for the Unwilling S User) AbouEl-Makarim Aboueissa wrote: Dear Sir/Madam: Could you please let me know which function shall I use to get the Greatest

Re: [R] Greatest common divisor of two numbers

2007-04-17 Thread Roland Rau
Hi, wouldn't it be enough for simple purposes (as stated in the original message: Greatest common divisor of two numbers) to use: gcd - function(a,b) ifelse (b==0, a, gcd(b, a %% b)) gcd(12,4) [1] 4 gcd(4,12) [1] 4 gcd(123456789,987654321) [1] 9 gcd(987654321,123456789) [1] 9 Best, Roland

Re: [R] Greatest common divisor of two numbers

2007-04-17 Thread AbouEl-Makarim Aboueissa
Thank you so much All. It works. Abou == AbouEl-Makarim Aboueissa, Ph.D. Assistant Professor of Statistics Department of Mathematics Statistics University of Southern Maine 96 Falmouth Street P.O. Box 9300 Portland, ME 04104-9300 Tel: (207) 228-8389 Email: [EMAIL