Sha256: 3a6501263aa987e75d3c4039435357dd402b6c6e4c82d4e55a9b7b46f14779a9
Contents?: true
Size: 1.27 KB
Versions: 1
Compression:
Stored size: 1.27 KB
Contents
require File.expand_path(File.join(File.dirname(__FILE__), 'test_helper')) class TC_f_abs_neg < Test::Unit::TestCase def setup @a=GMP::F.new(3.14) @b=GMP::F.new() @c=GMP::F.new(-3.14) @d=GMP::F.new(3.14) @e=GMP::F.new() @f=GMP::F.new(-3.14) end def test_neg assert_equal(-@a, @c, "-(x : GMP::Z) should be calculated correctly.") assert_equal(-@c, @a, "-(x : GMP::Z) should be calculated correctly.") assert_equal(-@b, @b, "-GMP::Z.new() should equal GMP::Z.new().") @d.neg!; @e.neg!; @f.neg! assert_equal(@d, @c, "(x : GMP::Z).neg! should be calculated correctly.") assert_equal(@e, @b, "(x : GMP::Z).neg! should be calculated correctly.") assert_equal(@f, @a, "GMP::Z.new().neg! should equal GMP::Z.new().") end def test_abs assert_equal([@a, 0, @a], [@a.abs, @b.abs, @c.abs], "(x : GMP::Z).abs should be calculated correctly.") @a.abs!; @b.abs!; @c.abs! assert_equal([@a, 0, @a], [@a, @b, @c], "(x : GMP::Z).abs! should be calculated correctly.") end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
gmp-0.6.47 | test/tc_f_abs_neg.rb |