]> gitweb.factorcode.org Git - factor.git/blob - extra/benchmark/e-ratios/e-ratios.factor
6d1e03b4d027390f0480212f12a218c508d6cb36
[factor.git] / extra / benchmark / e-ratios / e-ratios.factor
1 ! Copyright (C) 2009 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel math math.combinatorics math.ranges sequences ;
4 IN: benchmark.e-ratios
5
6 : calculate-e-ratios ( n -- e )
7     <iota> [ factorial recip ] map-sum ;
8
9 : e-ratios-benchmark ( -- )
10     5 [ 300 calculate-e-ratios drop ] times ;
11
12 MAIN: e-ratios-benchmark