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