Sha256: a39a66ece79c7baf84c043b154e8128c67c3853f05e209cca3d868491cfd02e6
Contents?: true
Size: 518 Bytes
Versions: 4
Compression:
Stored size: 518 Bytes
Contents
# -*- encoding: utf-8 -*- require 'test_helper' require 'hexapdf/utils.rb' describe HexaPDF::Utils do include HexaPDF::Utils it "checks floats for equality with a certain precision" do assert(float_equal(1.0, 1)) assert(float_equal(1.0, 1.0000003)) end it "compares floats like the <=> operator" do assert_equal(0, float_compare(1.0, 1)) assert_equal(0, float_compare(1.0, 1.0000003)) assert_equal(-1, float_compare(1.0, 1.03)) assert_equal(1, float_compare(1.0, 0.9997)) end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
hexapdf-0.37.1 | test/hexapdf/test_utils.rb |
hexapdf-0.37.0 | test/hexapdf/test_utils.rb |
hexapdf-0.36.0 | test/hexapdf/test_utils.rb |
hexapdf-0.35.1 | test/hexapdf/test_utils.rb |