Sha256: c3b05600e4d6460b8f28a0d01e8e40f05ccbcfba41afd0906bd6e46432b2f04c
Contents?: true
Size: 501 Bytes
Versions: 8
Compression:
Stored size: 501 Bytes
Contents
contexts: - name: "master" prelude: |- require 'bundler/setup' require 'enumerable/statistics' prelude: |- n = 1000 ary = Array.new(n) { rand } benchmark: inject: sum = ary.inject(:+) while: |- i, sum = 0, 0 while i < n sum += ary[i] i += 1 end pure_ruby: |- i, f, c = 0, 0.0, 0.0, 0.0, 0.0 while i < n x = ary[i] y = x - c t = f + y c = (t - f) - y f = t i += 1 end sum = f sum: sum = ary.sum
Version data entries
8 entries across 8 versions & 1 rubygems