知识卡片
最大公约数取最大公共正因子
gcd(a,b)是同时整除a和b的最大非负整数,二者不同时为零;约定gcd(0,0)=0以保持常用恒等式。
处理负数时仍取非负公约数,不把符号当成大小比较。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第31章 数论算法 · 查看原书依据
The greatest common divisor of two integers a and b which are not both 0, denoted by gcd(a, b), is the largest of the common divisors of a and b. For example, gcd(24, 30) = 6, gcd(5, 7) = 1, and gcd(0, 9) = 9. If a and b are both nonzero, then gcd(a, b) is an integer between 1 and min {|a|, |b|}. We define gcd(0, 0) to be 0, so that standard
参考来源
- 位置:《算法导论(第4版)》第31章《数论算法》(OEBPS/chapter031.xhtml,文本字符[5000,10000))。
- 结论依据:原文定义整除、素数、余数、同余类和最大公约数,或给出相应定理;公式图已核对。
- 原始内容:The greatest common divisor of two integers a and b which are not both 0, denoted by gcd( a , b ), is the largest of the common divisors of a and b . For example, gcd(24, 30) = 6, gcd(5, 7) = 1, and gcd(0, 9) = 9. If a and b are both nonzero, then gcd( a , b ) is an integer between 1 and min {| a |, | b |}. We define gcd(0, 0) to be 0, so that standard