Sha256: 4123b1ef49b51ae52d772026943e29d47203df933fe2248ec97ea23da917e915
Contents?: true
Size: 237 Bytes
Versions: 7
Compression:
Stored size: 237 Bytes
Contents
module Math # EPSILON = 0.000000001 # Approximately equal. # # TODO: Use core extension Numeric#approx? instead (?) def self.approx_equal(a, b, epsilon=EPSILON) c = a - b c *= -1.0 if c < 0 c < epsilon end end
Version data entries
7 entries across 6 versions & 2 rubygems