diff --git a/extra/benchmark/e-decimals/e-decimals.factor b/extra/benchmark/e-decimals/e-decimals.factor index d202e5ff76..7ef40aa65a 100644 --- a/extra/benchmark/e-decimals/e-decimals.factor +++ b/extra/benchmark/e-decimals/e-decimals.factor @@ -4,9 +4,12 @@ USING: decimals kernel locals math math.combinatorics math.ranges sequences ; IN: benchmark.e-decimals +: D-factorial ( n -- D! ) + D: 1 [ 0 D: 1 D+ D* ] reduce ; inline + :: calculate-e-decimals ( n -- e ) - n [1,b] [ factorial 0 D: 1 swap n D/ ] map - D: 1 [ D+ ] reduce ; + n [1,b] D: 1 + [ D-factorial D: 1 swap n D/ D+ ] reduce ; : calculate-e-decimals-benchmark ( -- ) 5 [ 800 calculate-e-decimals drop ] times ;