test/mpfr_tconst_euler.rb in gmp-0.5.41 vs test/mpfr_tconst_euler.rb in gmp-0.5.47
- old
+ new
@@ -1,14 +1,16 @@
-require './test_helper'
+require File.expand_path(File.join(File.dirname(__FILE__), 'test_helper'))
class MPFR_TCONST_EULER < Test::Unit::TestCase
def setup
@rand_state = GMP::RandState.new
if GMP::MPFR_VERSION >= "3.0.0"
+ @rnd_modes = [GMP::MPFR_RNDN, GMP::MPFR_RNDZ, GMP::MPFR_RNDU, GMP::MPFR_RNDD, GMP::MPFR_RNDA]
@mpfr_rnd_max = 5
else
+ @rnd_modes = [GMP::GMP_RNDN, GMP::GMP_RNDZ, GMP::GMP_RNDU, GMP::GMP_RNDD]
@mpfr_rnd_max = 4
end
end
def test_const_euler
@@ -21,16 +23,17 @@
(2..200).each do |p|
z.prec= p
t = GMP::F(0, p)
yprec = p+10
- (0...@mpfr_rnd_max).each do |rnd|
+ #(0...@mpfr_rnd_max).each do |rnd| # Can i emulate this?
+ (@rnd_modes).each do |rnd|
y.prec = yprec
- GMP::F.const_euler(y, rnd)
- err = rnd == GMP::GMP_RNDN ? yprec+1 : yprec
- if y.can_round?(err, rnd, rnd, p)
-
- end
+ #GMP::F.const_euler(y, rnd)
+ #err = rnd == GMP::GMP_RNDN ? yprec+1 : yprec
+ #if y.can_round?(err, rnd, rnd, p)
+ #
+ #end
end
end
end
end