Fix factorial
This commit is contained in:
parent
e53115b75c
commit
db3ec53031
@ -53,7 +53,7 @@ export default {
|
||||
'!': {
|
||||
fn: (a) => {
|
||||
let sum = 1;
|
||||
for (var i = 0; i < a; ++i) {
|
||||
for (var i = 1; i <= a; ++i) {
|
||||
sum *= i;
|
||||
}
|
||||
return sum;
|
||||
|
Loading…
Reference in New Issue
Block a user