diff options
Diffstat (limited to 'benchmark/float_predicate.yml')
| -rw-r--r-- | benchmark/float_predicate.yml | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/benchmark/float_predicate.yml b/benchmark/float_predicate.yml new file mode 100644 index 0000000000..b946937666 --- /dev/null +++ b/benchmark/float_predicate.yml @@ -0,0 +1,12 @@ +prelude: | + floats = [1.0, -1.0, 0.0, Float::NAN, Float::INFINITY, -Float::INFINITY] + +benchmark: + float_nan?: floats.each { |f| f.nan? } + float_finite?: floats.each { |f| f.finite? } + float_infinite?: floats.each { |f| f.infinite? } + float_zero?: floats.each { |f| f.zero? } + float_positive?: floats.each { |f| f.positive? } + float_negative?: floats.each { |f| f.negative? } + +loop_count: 1000000 |
