Skip to content

Instantly share code, notes, and snippets.

@seven-phases-max
Created October 27, 2013 16:50
Show Gist options
  • Save seven-phases-max/7184845 to your computer and use it in GitHub Desktop.
Save seven-phases-max/7184845 to your computer and use it in GitHub Desktop.
Calculating factorial in LESS
html {
.factorial(15);
}
.factorial(@n) {
.-(@n, 1);
.-(@i, @r) when (@i = 0) {factorial: @r}
.-(@i, @r) when (@i > 0) {
.-((@i - 1), (@r * @i));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment