How to compare Floats with delta?

ruby

Solution

(expected_float - actual_float).abs <= delta

Problem

Is there in Ruby some functionality/syntax to compare two floats with delta? Something similar to assert_in_delta(expected_float, actual_float, delta) from test/unit but returning Boolean?

Original source