repo.or.cz
/
ruby-svn.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
* transcode.c (trans_open_i): check the result of rb_transcoding_open.
[ruby-svn.git]
/
benchmark
/
other-lang
/
fact.py
blob
01593965d962eec6bbb08c7d436a15cda05e976d
1
#import sys
2
#sys.setrecursionlimit(1000)
3
4
def
factL
(
n
):
5
r
=
1
6
for
x
in
range
(
2
,
n
):
7
r
*=
x
8
return
r
9
10
def
factR
(
n
):
11
if
n
<
2
:
12
return
1
13
else
:
14
return
n
*
factR
(
n
-
1
)
15
16
for
i
in
range
(
10000
):
17
factR
(
100
)
18