Sha256: 3e1d09ccbd3b7bf44b582163d1b96a60c15856629848c51c7c5669db6a2e364f

Contents?: true

Size: 240 Bytes

Versions: 16

Compression:

Stored size: 240 Bytes

Contents

require 'facets/numeric/approx'
require 'test/unit'

class TestRound < Test::Unit::TestCase

  def test_approx?
    f = 10.006
    assert( f.approx?(10.01) )
    assert( f.approx?(10, 0.1) )
    assert( 100.4.approx?(100.6, 1) )
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
facets-2.8.4 test/core/numeric/test_approx.rb
facets-2.8.3 test/core/numeric/test_approx.rb
facets-2.8.2 test/core/numeric/test_approx.rb
facets-2.8.1 test/core/numeric/test_approx.rb
facets-2.8.0 test/core/numeric/test_approx.rb
facets-2.7.0 test/core/numeric/test_approx.rb
facets-2.6.0 test/core/numeric/test_approx.rb
facets-2.4.0 test/numeric/test_approx.rb
facets-2.4.1 test/numeric/test_approx.rb
facets-2.4.2 test/core/numeric/test_approx.rb
facets-2.4.4 test/core/numeric/test_approx.rb
facets-2.4.3 test/core/numeric/test_approx.rb
facets-2.5.0 test/core/numeric/test_approx.rb
facets-2.4.5 test/core/numeric/test_approx.rb
facets-2.5.1 test/core/numeric/test_approx.rb
facets-2.5.2 test/core/numeric/test_approx.rb