Skip to content

Instantly share code, notes, and snippets.

@aomoriringo
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aomoriringo/ce16ab3806f6d41911f7 to your computer and use it in GitHub Desktop.
Save aomoriringo/ce16ab3806f6d41911f7 to your computer and use it in GitHub Desktop.
source ./bigint.vim
function! Fib(n) abort
let [a,b,i] = [FromString("0"),FromString("1"),0]
while i < a:n
let [a,b,i] = [b,BigAdd(a,b),i+1]
endwhile
return ToString(a)
endfunction
:echo Fib(1000)
43466557686937456435688527675040625802564660517371780402481729089536555417949051890403879840079255169295922593080322634775209689623239873322471161642996440906533187938298969649928516003704476137795166849228875
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment