2012-08-02から1日間の記事一覧
Rubyで、100_000_000と書いても10**8と書いても1e8と書いても、そう大差はないと思っていたのですが、大きな間違いでした。 require 'benchmark' Benchmark.bm(15) do |x| x.report("100_000_000") { 1.upto(100_000_000){}} x.report("10**8") { 1.upto(10*…
Rubyで、100_000_000と書いても10**8と書いても1e8と書いても、そう大差はないと思っていたのですが、大きな間違いでした。 require 'benchmark' Benchmark.bm(15) do |x| x.report("100_000_000") { 1.upto(100_000_000){}} x.report("10**8") { 1.upto(10*…