1
2
3
4
5
6
7
8
9
require 'fruity'

x = 5
y = 4
compare "to_f then /" => -> { x.to_f / y },
        "fdiv" => -> { x.fdiv(y) }

# Running each test 32768 times. Test will take about 1 second.
# fdiv is faster than to_f then / by 2.6x ± 0.1