src/cplib/math/ext_gcd
Dark Mode
Index
Search:
Group by:
Section
Type
Consts
CPLIB_MATH_EXT_GCD
Procs
ext_gcd
ext_gcd(a, b: int): (int, int)
Source
Edit
Consts
CPLIB_MATH_EXT_GCD
=
1
Source
Edit
Procs
proc
ext_gcd
(
a
,
b
:
int
)
:
(
int
,
int
)
{.
...
raises
:
[
]
,
tags
:
[
]
.}
a
x + b
y = gcd(a, b) となる (x, y) をひとつ返す。 返す値はそのような(x, y) のうち |x| + |y| が最小となるもの
Source
Edit