PageRenderTime 49ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/gems/facets-2.4.5/test/core/numeric/test_approx.rb

https://bitbucket.org/mediashelf/fedora-migrator
Ruby | 13 lines | 10 code | 3 blank | 0 comment | 0 complexity | 1e36d9ead51ba3a5a4fbae382260ce01 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
  1. require 'facets/numeric/approx'
  2. require 'test/unit'
  3. class TestRound < Test::Unit::TestCase
  4. def test_approx?
  5. f = 10.006
  6. assert( f.approx?(10.01) )
  7. assert( f.approx?(10, 0.1) )
  8. assert( 100.4.approx?(100.6, 1) )
  9. end
  10. end