Sha256: bcfe0fe341e7ea12f275ee4be708c042efc5f9102815ed586f544a830cafcc4f

Contents?: true

Size: 125 Bytes

Versions: 5

Compression:

Stored size: 125 Bytes

Contents

class Float
  # Equals for floats with tolerance
  def equals?(x, tolerance = 1e-6)
    (self - x).abs < tolerance
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
darkhelmet-darkext-0.11.0 lib/darkext/float.rb
darkhelmet-darkext-0.11.1 lib/darkext/float.rb
darkhelmet-darkext-0.11.2 lib/darkext/float.rb
darkhelmet-darkext-0.12.0 lib/darkext/float.rb
darkext-0.12.0 lib/darkext/float.rb