Skip to content

Instantly share code, notes, and snippets.

@axgle
Created October 26, 2009 10:05
Show Gist options
  • Save axgle/218542 to your computer and use it in GitHub Desktop.
Save axgle/218542 to your computer and use it in GitHub Desktop.
require 'ffi-inliner'
module A
extend Inliner
inline '
int sum(int e){
int s=0,i=0;
for(i=1;i<=e;i++){
s+=i;
}
return s;
}
'
end
p A.sum(100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment