summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-complex/mrblib
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-03-24 11:06:14 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2021-03-24 11:06:14 +0900
commit9ed212ef9eedb09c5368a338ff905e25cdba149f (patch)
treebbbb2cb4da9931ce252063096c3a89ed58022c6e /mrbgems/mruby-complex/mrblib
parentfa3ac351ff86efe517180afa6159679887656ced (diff)
downloadmruby-9ed212ef9eedb09c5368a338ff905e25cdba149f.tar.gz
mruby-9ed212ef9eedb09c5368a338ff905e25cdba149f.zip
complex.c: implement `Complex` addition and subtraction in C.
Diffstat (limited to 'mrbgems/mruby-complex/mrblib')
-rw-r--r--mrbgems/mruby-complex/mrblib/complex.rb16
1 files changed, 0 insertions, 16 deletions
diff --git a/mrbgems/mruby-complex/mrblib/complex.rb b/mrbgems/mruby-complex/mrblib/complex.rb
index 105c56d40..cd000a6c6 100644
--- a/mrbgems/mruby-complex/mrblib/complex.rb
+++ b/mrbgems/mruby-complex/mrblib/complex.rb
@@ -19,22 +19,6 @@ class Complex < Numeric
Complex(-real, -imaginary)
end
- def +(rhs)
- if rhs.is_a? Complex
- Complex(real + rhs.real, imaginary + rhs.imaginary)
- elsif rhs.is_a? Numeric
- Complex(real + rhs, imaginary)
- end
- end
-
- def -(rhs)
- if rhs.is_a? Complex
- Complex(real - rhs.real, imaginary - rhs.imaginary)
- elsif rhs.is_a? Numeric
- Complex(real - rhs, imaginary)
- end
- end
-
def abs
Math.hypot imaginary, real
end