Skip to content

Instantly share code, notes, and snippets.

@Riduidel
Created January 13, 2010 15:34
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 Riduidel/276280 to your computer and use it in GitHub Desktop.
Save Riduidel/276280 to your computer and use it in GitHub Desktop.
def fact(number) {
result = 1G;
for(i in 1..number) {
result *= i;
}
return result;
}
f = fact(100);
text = f.toString();
sum = 0G;
text.findAll("[0-9]", {
sum += Integer.valueOf(it);
})
println sum;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment