summaryrefslogtreecommitdiff
path: root/spec/ruby/shared/complex/conjugate.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/shared/complex/conjugate.rb')
-rw-r--r--spec/ruby/shared/complex/conjugate.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/ruby/shared/complex/conjugate.rb b/spec/ruby/shared/complex/conjugate.rb
new file mode 100644
index 0000000000..d1ae47bcb6
--- /dev/null
+++ b/spec/ruby/shared/complex/conjugate.rb
@@ -0,0 +1,8 @@
+describe :complex_conjugate, shared: true do
+ it "returns the complex conjugate: conj a + bi = a - bi" do
+ Complex(3, 5).send(@method).should == Complex(3, -5)
+ Complex(3, -5).send(@method).should == Complex(3, 5)
+ Complex(-3.0, 5.2).send(@method).should be_close(Complex(-3.0, -5.2), TOLERANCE)
+ Complex(3.0, -5.2).send(@method).should be_close(Complex(3.0, 5.2), TOLERANCE)
+ end
+end