けいじゅ@日本ラショナルソフトウェアです.

ruby-mathに行きます.

# 英語での議論はなんなんで(^^;;;

確に, 現行の

  Complex#<=>

は, わかりにくいですね. 

# ここまでRubyが広まるとね(^^;;;

ごとけんさんのコメントがよく分らなかったのですが, 誰も異論がないなら削除
しようと思います.

あと, 昔から問題だと指摘のあった

  Complex#to_[ifr]

ですが,

  Complex#to_z[ifr]

に変更しようと思いますが, 如何でしょう?

あ, あと

  @image -> @imaginary

を変えるって話がありましたよね? 

他にも何かあったような気がするなぁ...


In the message: "Forward: inconsistence in class complex ", on Feb/25 17:40(JST) 
Yukihiro Matsumoto writes:

>まつもと ゆきひろです
>
>英語メーリングリストに出てたComplexに<=>は定義不能ではないか
>と言う話。
>
>------- Start of forwarded message -------
>Date: Mon, 25 Feb 2002 17:23:41 +0900
>Posted: 25 Feb 2002 00:04:40 -0800
>From: juergen.katins / epost.de (Juergen Katins)
>Reply-To: ruby-talk / ruby-lang.org
>Subject: inconsistence in class complex
>To: ruby-talk / ruby-lang.org (ruby-talk ML), undisclosed-recipients: ;
>X-ML-Name: ruby-talk
>X-Mail-Count: 34750
>
>While translating the book "Programming Ruby" by Dave Thomas and
>Andrew Hunt into german language (see
>http://home.vr-web.de/juergen.katins/ruby/) I stumbled arcoss an
>irritating inconsistence in the standard library. In the class complex
>there is a comparision operator <=>.
>
><=> ref <=> other -> -1, 0, +1  
>Returns ref.abs <=> other.abs.  
>
>In mathematical meanings this makes no sense! You can not compare
>complex numbers! This is due to the following reason:
>Normally you would expect a comparision to be compatible with
>addition. You expect:
>If a > b then a+c > b+c. 
>This rule can not be accomplished with this compare method. Example: 
>(0 + 2i) > (1 + 0i) is true, but 
>(0 + 2i)+(2 + 0i) > (1 + 0i)+(2 + 0i) is false!
>
>This wrongly comparision method leeds to the need of an additional
>equation operator ==, also something you would not expect. If you see
>a=b you would expect the two numbers to be the same, not to have the
>same length.
>Following the principle of least surprise I would strongly recommend
>for the next version of ruby to discard the complex operators <=> and
>==, leaving only the operator = which should work as you would expect.
>
>PS: Do not try to invent a comparision which is compatible with
>addition. This is possible but then the comparision will not be
>compatible with multiplication.
>
>Regards
>
>J◯rgen Katins
>
>
>------- End of forwarded message -------
>

__
..............................石塚 圭樹@日本ラショナルソフトウェア...
----------------------------------->> e-mail: keiju / rational.com <<---