Sha256: 698e65838606c46d5ba295a419dbe58923eb77f2b7e7a85a2c1fa8fdd517da30

Contents?: true

Size: 586 Bytes

Versions: 3

Compression:

Stored size: 586 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), "../spec_helper.rb"))

describe MPFR, "when creating random number" do
  before(:all) do
    @prec = 200
    MPFR.set_default_prec(@prec)
    @creator = [GMP::RandState.new, GMP::RandState.new(:mt),
                GMP::RandState.new(:lc_2exp, 3, 4, 10), GMP::RandState.new(:lc_2exp_size, 93)]
  end

  it "should return MPFR objects" do
    @creator.each do |c|
      10.times do |i|
        n = c.mpfr_urandomb2
        n.should be_an_instance_of MPFR
        n.should >= 0
        n.should <= 1
      end
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby-mpfr-0.0.17 spec/gmp/rand_spec.rb
ruby-mpfr-0.0.16 spec/gmp/rand_spec.rb
ruby-mpfr-0.0.15 spec/gmp/rand_spec.rb