From 9ed212ef9eedb09c5368a338ff905e25cdba149f Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 24 Mar 2021 11:06:14 +0900 Subject: complex.c: implement `Complex` addition and subtraction in C. --- mrbgems/mruby-complex/mrblib/complex.rb | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'mrbgems/mruby-complex/mrblib/complex.rb') 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 -- cgit v1.2.3