diff options
Diffstat (limited to 'spec/ruby/core/complex/conjugate_spec.rb')
| -rw-r--r-- | spec/ruby/core/complex/conjugate_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/ruby/core/complex/conjugate_spec.rb b/spec/ruby/core/complex/conjugate_spec.rb new file mode 100644 index 0000000000..256fe4b3be --- /dev/null +++ b/spec/ruby/core/complex/conjugate_spec.rb @@ -0,0 +1,10 @@ +require_relative '../../spec_helper' + +describe "Complex#conjugate" do + it "returns the complex conjugate: conj a + bi = a - bi" do + Complex(3, 5).conjugate.should == Complex(3, -5) + Complex(3, -5).conjugate.should == Complex(3, 5) + Complex(-3.0, 5.2).conjugate.should be_close(Complex(-3.0, -5.2), TOLERANCE) + Complex(3.0, -5.2).conjugate.should be_close(Complex(3.0, 5.2), TOLERANCE) + end +end |
