]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/benchmark/e-decimals/e-decimals.factor
factor: trim using lists
[factor.git] / extra / benchmark / e-decimals / e-decimals.factor
index a7d875af3fe9c12aff922bd7dc486a4e5f22656a..d7bdf9880dc7540fc0972312fbccaaed805c3d87 100644 (file)
@@ -1,17 +1,16 @@
 ! Copyright (C) 2009 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: decimals kernel locals math math.combinatorics math.ranges
-sequences ;
+USING: decimals kernel math ranges sequences ;
 IN: benchmark.e-decimals
 
 : D-factorial ( n -- D! )
-    iota D: 1 [ 0 <decimal> D: 1 D+ D* ] reduce ; inline
+    <iota> DECIMAL: 1 [ 0 <decimal> DECIMAL: 1 D+ D* ] reduce ; inline
 
 :: calculate-e-decimals ( n -- e )
-    n [1,b] D: 1
-    [ D-factorial D: 1 swap n D/ D+ ] reduce ;
+    n [1..b] DECIMAL: 1
+    [ D-factorial DECIMAL: 1 swap n D/ D+ ] reduce ;
 
-: calculate-e-decimals-benchmark ( -- )
+: e-decimals-benchmark ( -- )
     5 [ 800 calculate-e-decimals drop ] times ;
 
-MAIN: calculate-e-decimals-benchmark
+MAIN: e-decimals-benchmark