]> gitweb.factorcode.org Git - factor.git/blob - extra/benchmark/e-ratios/e-ratios.factor
factor: trim using lists
[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 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