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