summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-complex/mrblib/complex.rb
diff options
context:
space:
mode:
Diffstat (limited to 'mrbgems/mruby-complex/mrblib/complex.rb')
-rw-r--r--mrbgems/mruby-complex/mrblib/complex.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/mrbgems/mruby-complex/mrblib/complex.rb b/mrbgems/mruby-complex/mrblib/complex.rb
index 1025e975e..f32b84c8b 100644
--- a/mrbgems/mruby-complex/mrblib/complex.rb
+++ b/mrbgems/mruby-complex/mrblib/complex.rb
@@ -45,8 +45,7 @@ class Complex < Numeric
def /(rhs)
if rhs.is_a? Complex
- div = rhs.real * rhs.real + rhs.imaginary * rhs.imaginary
- Complex((real * rhs.real + imaginary * rhs.imaginary) / div, (rhs.real * imaginary - real * rhs.imaginary) / div)
+ __div__(rhs)
elsif rhs.is_a? Numeric
Complex(real / rhs, imaginary / rhs)
end