Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\math\gcd.c Create Date:2022-07-28 06:43:17
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:gcd - calculate and return the greatest common divisor of 2 unsigned longs*@a: first value*@b: second value

Proto:unsigned long gcd(unsigned long a, unsigned long b)

Type:unsigned long

Parameter:

TypeParameterName
unsigned longa
unsigned longb
25  r = a | b
27  If Not a || Not b Then Return r
30  b >>= __ffs - find first set bit in word*@word: The word to search* Undefined if no bit exists, so code should check against 0 first.
31  If b == 1 Then Return r & -r
34  cycle
35  a >>= __ffs - find first set bit in word*@word: The word to search* Undefined if no bit exists, so code should check against 0 first.
36  If a == 1 Then Return r & -r
38  If a == b Then Return a << __ffs - find first set bit in word*@word: The word to search* Undefined if no bit exists, so code should check against 0 first.
41  If a < b Then swap - swap values of @a and @b*@a: first value*@b: second value(a, b)
43  a -= b
Caller
NameDescribe
lcmLowest common multiple