Created
October 3, 2011 12:18
-
-
Save kaneshin/1258984 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
" Greatest Common Divisor - vim | |
command! -nargs=+ GreatestCommonDivisor :echo s:gdb(<f-args>) | |
function! s:gdb(a, b) | |
let l:r = a:a % a:b | |
if l:r | |
return s:gdb(a:b, l:r) | |
else | |
return a:b | |
endif | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment