Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v2_1_10) is shown here.
assert_in_delta(exp, act, delta = 0.001, msg = nil)
public
For comparing Floats. Fails unless exp and act are
within delta of each other.
assert_in_delta Math::PI, (22.0 / 7.0), 0.01
# File lib/minitest/unit.rb, line 238
def assert_in_delta exp, act, delta = 0.001, msg = nil
n = (exp - act).abs
msg = message(msg) {
"Expected |#{exp} - #{act}| (#{n}) to be <= #{delta}"
}
assert delta >= n, msg
end