diff options
author | Yaw Boakye <[email protected]> | 2018-10-12 02:04:46 +0200 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2019-08-05 09:04:32 +0900 |
commit | 6bb3618f281e1cdbb28fe38ee88287da9b1838e8 (patch) | |
tree | 88c86a9cb4bfbf882050a4e13f2dcc616052a63e /benchmark/other-lang | |
parent | 253da5b2196ccef2a2bf66ca4e7305118f79198a (diff) |
n+1 to include n in range
Python's range stop right before n, which means factL never returns the correct result.
Closes: https://github.com/ruby/ruby/pull/1982
Diffstat (limited to 'benchmark/other-lang')
-rw-r--r-- | benchmark/other-lang/fact.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/benchmark/other-lang/fact.py b/benchmark/other-lang/fact.py index 01593965d9..1ce9f76275 100644 --- a/benchmark/other-lang/fact.py +++ b/benchmark/other-lang/fact.py @@ -3,7 +3,7 @@ def factL(n): r = 1 - for x in range(2, n): + for x in range(2, n+1): r *= x return r |