请输入您要查询的字词:

 

单词 euclidean algorithm
释义

Euclidean Algorithm

A special way to find the greatest common factor of two integers.

With the larger number in 1st spot:
• divide the 1st number by the 2nd number. Note down the remainder.
• move the 2nd number into 1st spot, and put the remainder from the previous step in 2nd spot
• repeat until the remainder is zero

The last non-zero remainder is the greatest common factor

Example: 112 and 42
divide 112 by 42. We get 2 with a remainder of 28
divide 42 by 28. We get 1 with a remainder of 14
divide 28 by 14. We get 2 with a remainder of 0

The last non-zero remainder is 14, so the greatest common factor of 112 and 42 is 14


In JavaScript:
function gcf(a, b) {  while (b != 0) {    t = b;    b = a % b;    a = t;  }  return a;}
See: Greatest Common Factor

随便看

 

数学辞典收录了1200条数学词条,基本涵盖了常用数学知识及数学英语单词词组的翻译及用法,是数学学习的有利工具。

 

Copyright © 2000-2023 Newdu.com.com All Rights Reserved
更新时间:2025/5/13 18:01:34