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-7.6.0 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-7.5.1 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-7.4.1 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-7.1.17 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-6.2.0 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-6.0.11 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-5.5.18 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-5.5.17 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-5.5.15 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-5.5.0.22 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-5.5.2 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-5.5.0.7 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-5.5.0.3 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-5.5.0 spec/framework_spec/app/spec/shared/complex/abs2.rb
tauplatform-1.0.3 spec/framework_spec/app/spec/shared/complex/abs2.rb
tauplatform-1.0.2 spec/framework_spec/app/spec/shared/complex/abs2.rb
tauplatform-1.0.1 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-3.5.1.12 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-3.3.5 spec/framework_spec/app/spec/shared/complex/abs2.rb
rhodes-3.4.2 spec/framework_spec/app/spec/shared/complex/abs2.rb