diff options
Diffstat (limited to 'data/math/factorial')
-rw-r--r-- | data/math/factorial | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/data/math/factorial b/data/math/factorial index c5b9ce7..95d0cd4 100644 --- a/data/math/factorial +++ b/data/math/factorial @@ -29,7 +29,10 @@ def calculate(number, type): type_s = 'iterative' factorial_iterative(number) delta = time.time() - start - print 'Type: ', type_s, ' in: ', 1 / delta + if delta > 0: + print 'Type: ', type_s, ' in: ', 1 / delta + else: + print 'Type: ', type_s # ask for a number to compute the factorial of number = input('Please input a number:') |