Last active
December 24, 2019 12:24
-
-
Save nobishino/4a6a0ccb2234683ab2f0cde6ddb77f94 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with recursive euclid(x,y) as ( | |
select 56,12 | |
union all | |
select y, x%y from euclid | |
where y != 0 | |
) | |
select x from euclid | |
where y = 0; | |
/* | |
4 = gcd(56,12) | |
*/ | |
with recursive euclid(x,y) as ( | |
select 4563132817,31176473253 | |
union all | |
select y, x%y from euclid | |
where y != 0 | |
) | |
select x from euclid | |
where y = 0; | |
/* 1 がかえるので互いに素 */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
一応チェックした