Sha256: 747a68829da9f3dc329fc099d9c511c82a2ae3ac7224e4b05f8110109d4f6794

Contents?: true

Size: 510 Bytes

Versions: 3

Compression:

Stored size: 510 Bytes

Contents

require_relative "../spec_helper"

describe MPFI, "when puting arithmetic operation" do
  before(:all) do
    MPFR.set_default_prec(150)
    @args = GenerateNumber.float(5000).map{ |a| MPFI.new(a) }
  end

  it "should increase diameter" do
    @args.each_index do |i|
      if i > 0
        diam_sum = @args[i-1].diam + @args[i].diam
        add = @args[i-1] + @args[i]
        sub = @args[i-1] - @args[i]
        add.diam.should >= diam_sum
        sub.diam.should >= diam_sum
      end
    end
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby-mpfi-0.0.10 spec/mpfi/mpfi_diam_arithmetic_spec.rb
ruby-mpfi-0.0.9 spec/mpfi/mpfi_diam_arithmetic_spec.rb
ruby-mpfi-0.0.8 spec/mpfi/mpfi_diam_arithmetic_spec.rb