Sha256: ae6a21a8c2afab33447514e9654966d61463a9b5a4f71bb3b247edbb0aaac14f

Contents?: true

Size: 1.21 KB

Versions: 4

Compression:

Stored size: 1.21 KB

Contents

#!/usr/bin/env ruby

require 'test_helper'
require 'tc_z'
require 'tc_z_basic'
require 'tc_z_logic'
require 'tc_q'
require 'tc_cmp'
require 'tc_q_basic'
require 'tc_z_exponentiation'
require 'tc_zerodivisionexceptions'
require 'tc_sgn_neg_abs'
require 'tc_fib_fac_nextprime'
require 'tc_swap'
require 'tc_floor_ceil_truncate'
require 'tc_z_to_d_to_i'
require 'tc_z_shifts_last_bits'
require 'tc_logical_roots'
require 'tc_f_precision'
require 'tc_f_arithmetics_coersion'
require 'tc_division'
require 'tc_z_jac_leg_rem'
require 'tc_z_gcd_lcm_invert'
require 'tc_random'

class TC_default_prec < Test::Unit::TestCase
  def test_default_prec
    assert_equal( 64, GMP::F.default_prec, "GMP::F.default_prec should be 64.")
    GMP::F.default_prec = 100
    assert_equal(128, GMP::F.default_prec, "GMP::F.default_prec should be assignable.")
    GMP::F.default_prec = 130
    assert_equal(160, GMP::F.default_prec, "GMP::F.default_prec should be assignable.")
    GMP::F.default_prec = 1000
    assert_equal(1024, GMP::F.default_prec, "GMP::F.default_prec should be assignable.")
    assert_raise(RangeError) { GMP::F.default_prec = -64 }
    assert_raise(TypeError) { GMP::F.default_prec = "Cow" }
    GMP::F.default_prec =  64
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gmp-0.4.1-x86-mingw32 test/unit_tests.rb
gmp-0.4.1 test/unit_tests.rb
gmp-0.4.0-x86-mingw32 test/unit_tests.rb
gmp-0.4.0 test/unit_tests.rb