Sha256: dfc1ae9d92e1d03e141ad86a50a9bb7863dc0dcdeb932354706f0d8f0f704887

Contents?: true

Size: 399 Bytes

Versions: 52

Compression:

Stored size: 399 Bytes

Contents

require File.expand_path('../../../spec_helper', __FILE__)

describe :complex_abs2, :shared => true do
  it "returns the sum of the squares of the real and imaginary parts" do
    Complex(1, -2).abs2.should == 1 + 4
    Complex(-0.1, 0.2).abs2.should be_close(0.01 + 0.04, TOLERANCE)
    # Guard against Mathn library
    conflicts_with :Prime do
      Complex(0).abs2.should == 0
    end
  end
end

Version data entries

52 entries across 52 versions & 2 rubygems

Version Path
rhodes-3.2.2 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-3.2.2.beta spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-3.2.1 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-3.2.0 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-3.2.0.beta.9 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-3.2.0.beta.8 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-3.2.0.beta.7 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-3.2.0.beta.6 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-3.2.0.beta.5 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-3.2.0.beta.4 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-3.2.0.beta.2 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-3.2.0.beta.1 spec/framework_spec/app/spec/shared/complex/abs2.rb