From: Masahiro TANAKA Date: 2000-01-08T23:15:47+09:00 Subject: [ruby-dev:8886] Complex#divmod 田中@ISASです。ついでに気になっていることを。 Complex#divmod の振る舞いがよくわかりません。 lib/complex.rb の以下のパッチは正しいでしょうか? def divmod(other) if other.kind_of?(Complex) rdiv, rmod = @real.divmod(other.real) idiv, imod = @image.divmod(other.image) - return Complex(rdiv, idiv), Complex(rmod, rdiv) + return Complex(rdiv, idiv), Complex(rmod, imod) elsif Complex.generic?(other) Complex(@real.divmod(other), @image.divmod(other)) else x , y = other.coerce(self) x.divmod(y) end end これにしても、複素数の割り算からは連想できなかったのですが... 田中昌宏