{Complex,Rational}::Unify

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:36657] Re: {Complex,Rational}::Unify”
on Fri, 3 Oct 2008 21:52:39 +0900, [email protected]
(e$B@PDM7=<ye(B) writes:

|>e$B$G$O!";C$/$O$3$l$G$$$$$H$7$F!"$f$C$/$j$He(B 2.0 e$B$^$G$NCf4|E*$JBP:v$K$D$$$Fe(B
|>e$B9M$($^$7$g$&!#e(B
|
|e$B>>K$5$s$,8r>D$7$F$/$l$k$H8@$C$F$$$k$N$Ge(B, e$B$G$-$l$Pe(B, e$B:#2s$N$K>h$C$+$k$He(B
|e$B$&$l$7$$$N$G$9$,e(B. e$B$b$A$m$se(B, e$B$"$^$j;~4V$,$J$$$N$GBg3]$+$j$J$3$H$O$G$-$Je(B
|e$B$/$J$k$H;W$$$^$9$,e(B…

e$B$(!<$H!“e(Bmathne$B$He(Bcomplex,rationale$B$=$l$>$l$Ne(BAPIe$B$OJQ99$7$J$$$H$$e(B
e$B$&>r7o$G!“e(Bmathne$B$He(Bcomplex,rationale$B$N3&LL$K$D$$$F$Oe(B10/25e$B$^$GJQe(B
e$B992D$H$$$&$3$H$K$7$^$9!#$G!”%S%k%H%$%sB&$,e(Bmathne$B$X$NFCJL07$$$re(B
e$B4^$`$+!”$=$l$H$be(Bmathne$BC1BN$G$$$m$s$J%a%=%C%I$r:FDj5A$9$k$N$+$Oe(B
e$B$=$N4V$K8r>D$7$F$/$@$5$$!#<BAu4|4V$r9M$($k$H$=$s$J$KM>M5$O$Je(B
e$B$$$H;W$$$^$9$,!#e(B

                            e$B$^$D$b$He(B e$B$f$-$R$me(B /:|)

e$B$1$$$8$e!w$$$7$D$+$G$9e(B.

In [ruby-dev :36658 ] the message: "[ruby-dev:36658] Re:
{Complex,Rational}::Unify ", on Oct/04 00:59(JST) Yukihiro M.
writes:

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

e$B$(!<$H!“e(Bmathne$B$He(Bcomplex,rationale$B$=$l$>$l$Ne(BAPIe$B$OJQ99$7$J$$$H$$e(B
e$B$&>r7o$G!“e(Bmathne$B$He(Bcomplex,rationale$B$N3&LL$K$D$$$F$Oe(B10/25e$B$^$GJQe(B
e$B992D$H$$$&$3$H$K$7$^$9!#$G!”%S%k%H%$%sB&$,e(Bmathne$B$X$NFCJL07$$$re(B
e$B4^$`$+!”$=$l$H$be(Bmathne$BC1BN$G$$$m$s$J%a%=%C%I$r:FDj5A$9$k$N$+$Oe(B
e$B$=$N4V$K8r>D$7$F$/$@$5$$!#<BAu4|4V$r9M$($k$H$=$s$J$KM>M5$O$Je(B
e$B$$$H;W$$$^$9$,!#e(B

e$B?7e(Bmathne$B=PMh$^$7$?e(B.

e$B%=!<%9%$%a!<%8$G$Oe(B

lib/mathn.rb
ext/mathn/complex/complex.c
ext/mathn/rational/rational.c

e$B$NAH9g$o$;$K$J$C$F$$$^$9e(B. ext/*/{complex,rational}.c e$B$Oe(B
e$B%S%k%H%$%s$Ne(B
{complex,rational}.c e$B$K:GDc8B$NJQ99$r2C$($?$b$N$G$9e(B. e$B$"$He(B,
make e$B;~$Ke(B-D
e$B$7$F$$$k$3$H$0$i$$$G$9e(B.

e$B%3!<%I$NIJ<A$Oe(B,
e$B;ve$NJQ99$O$"$j$^$;$s$N$Ge(B(e$B4X?tL>$NJQ99$He(B, e$BDj?tDj5Ae(B
e$B$N:o=|Eye(B)e$B%S%k%H%$%s$Ne(B {complex,rational}.c e$B$HF1Ey$G$9e(B.

e$B<h$j$"$($:e(B, e$B%A%’%C%/%$%s$7$F$h$m$7$$$G$7$g$&$+e(B?

__
---------------------------------------------------->> e$B@PDMe(B
e$B7=<ye(B <<—
---------------------------------->> e-mail: [email protected] <<—

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:36883] Re: {Complex,Rational}::Unify”
on Thu, 23 Oct 2008 18:49:24 +0900, [email protected]
(e$B@PDM7=<ye(B) writes:

|e$B?7e(Bmathne$B=PMh$^$7$?e(B.
|
|e$B%=!<%9%$%a!<%8$G$Oe(B
|
| lib/mathn.rb
| ext/mathn/complex/complex.c
| ext/mathn/rational/rational.c
|
|e$B$NAH9g$o$;$K$J$C$F$$$^$9e(B. ext/*/{complex,rational}.c e$B$Oe(B e$B%S%k%H%$%s$Ne(B
|{complex,rational}.c e$B$K:GDc8B$NJQ99$r2C$($?$b$N$G$9e(B. e$B$"$He(B, make e$B;~$Ke(B-D
|e$B$7$F$$$k$3$H$0$i$$$G$9e(B.

e$B$(!<$H!"Fs=E$K;}$C$F$$$k$H$$$&$3$H$G$7$g$&$+!#e(B

|e$B%3!<%I$NIJ<A$Oe(B, e$B;ve$NJQ99$O$"$j$^$;$s$N$Ge(B(e$B4X?tL>$NJQ99$He(B, e$BDj?tDj5Ae(B
|e$B$N:o=|Eye(B)e$B%S%k%H%$%s$Ne(B {complex,rational}.c e$B$HF1Ey$G$9e(B.
|
|e$B<h$j$"$($:e(B, e$B%A%’%C%/%$%s$7$F$h$m$7$$$G$7$g$&$+e(B?

Rubye$B$+$i$_$?e(BAPIe$B$OJQ$o$i$J$$e(B(e$B$HG’<1$7$F$$$^$9e(B)e$B$N$G!"%A%’%C%/G$e(B
e$B$K$"$^$jLdBj$O$J$$$H;W$$$^$9!#$?$@!"G0$N$?$ae(BYuguie$B$5$s$Ne(BOKe$B$rBT$Ce(B
e$B$F$/$@$5$$!#e(B

                            e$B$^$D$b$He(B e$B$f$-$R$me(B /:|)

Yuguie$B$G$9!#e(B

Yukihiro M. e$B$5$s$O=q$-$^$7$?e(B:

Rubye$B$+$i$_$?e(BAPIe$B$OJQ$o$i$J$$e(B(e$B$HG’<1$7$F$$$^$9e(B)e$B$N$G!"%A%’%C%/G$e(B
e$B$K$"$^$jLdBj$O$J$$$H;W$$$^$9!#$?$@!"G0$N$?$ae(BYuguie$B$5$s$Ne(BOKe$B$rBT$Ce(B
e$B$F$/$@$5$$!#e(B

APIe$B$,JQ$o$i$J$$$J$i$PNI$$$H;W$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ruby-dev :36903 ] the message: "[ruby-dev:36903] Re:
{Complex,Rational}::Unify ", on Oct/24 16:34(JST) Yukihiro M.
writes:

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

|e$B?7e(Bmathne$B=PMh$^$7$?e(B.

| lib/mathn.rb
| ext/mathn/complex/complex.c
| ext/mathn/rational/rational.c

|e$B$NAH9g$o$;$K$J$C$F$$$^$9e(B. ext/*/{complex,rational}.c e$B$Oe(B e$B%S%k%H%$%s$Ne(B
|{complex,rational}.c e$B$K:GDc8B$NJQ99$r2C$($?$b$N$G$9e(B. e$B$"$He(B, make e$B;~$Ke(B-D
|e$B$7$F$$$k$3$H$0$i$$$G$9e(B.

e$B$(!<$H!"Fs=E$K;}$C$F$$$k$H$$$&$3$H$G$7$g$&$+!#e(B

e$B$=$&$G$9e(B. e$BK\2H$rJQ$($F$b$i$&$o$1$K$b9T$+$J$$$N$Ge(B.

Rubye$B$+$i$_$?e(BAPIe$B$OJQ$o$i$J$$e(B(e$B$HG’<1$7$F$$$^$9e(B)e$B$N$G!"e(B

e$B$O$$e(B. e$BBg>fIW$G$9e(B. mathn
e$B%$%s%/%k!<%I8e$Ne(BAPIe$B$*$h$S?6$kIq$$$OJQ$o$C$F$$e(B
e$B$^$;$se(B.

e$B%A%’%C%/G$e(B
e$B$K$"$^$jLdBj$O$J$$$H;W$$$^$9!#$?$@!"G0$N$?$ae(BYuguie$B$5$s$Ne(BOKe$B$rBT$Ce(B
e$B$F$/$@$5$$!#e(B

e$BN;2r$G$9e(B.

__
---------------------------------------------------->> e$B@PDMe(B
e$B7=<ye(B <<—
---------------------------------->> e-mail: [email protected] <<—

e$B$1$$$8$e!w$$$7$D$+$G$9e(B.

In [ruby-dev :36908 ] the message: "[ruby-dev:36908] Re:
{Complex,Rational}::Unify ", on Oct/24 20:01(JST) “Yugui (Yuki
Sonoda)” writes:

Yuguie$B$G$9!#e(B

e$B%3%_%C%H$r3NG’$7$^$7$?!#e(B
e$B<BAu$K$D$$$F4v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Q$($?$N$OM}M3$,0c$C$F$$$Fe(B, builtin
e$B$NJ}$Oe(B, e$B8=e(B
e$B:_e(B-DCANONe$B$G%3%s%Q%$%k$9$k$H%(%i!<$K$J$k$N$G$=$l$KBP=h$9$k$?$a$G$9e(B.

e$B$H$$$&$N$O!"e(Bmathn/{rational,complex}e$B$O%=!<%9%3!<%I%l%Y%k$Ge(B{rational,
complex}.ce$B$K0MB8$7$F$$$k$N$G!"7k6I$N=h$OAH$9~$%/%i%9$NG[N8$rI,MW$H$9$ke(B
e$B$N$G$O$J$$$G$9$+e(B?

e$B$$$(e(B, e$B$@$+$i$3$=%3%T!<$K$7$^$7$?e(B. e$B:#8ee(B,
e$BAH$9~$$NJ}$G$Oe(B, e$B8=:_$N$H$3$me(B,
e$B%=!<%9%l%Y%k$G$OG[N8$5$l$F$$$^$9$,e(B,
e$B:#8e$I$N$h$&$K?J2=$9$k$+$O<+M3$K$Ge(B
e$B$-$^$9e(B.

__
---------------------------------------------------->> e$B@PDMe(B
e$B7=<ye(B <<—
---------------------------------->> e-mail: [email protected] <<—

Yuguiです。

石塚圭樹 さんは書きました:

本当にこんなにコードのコピーを持つ必要がありますか? 一部のメソッドだけ再
定義するのでは足りませんか?

一部といっても, RationalやComplexを返す物すべてですので, ほとんどすべ
てのメソッドになってしまうと思います.

まぁ、それもそうですね。
と、すると大幅な重複定義はやむを得ません。しかし、今後の組み込みクラスの
ほうの改善なり何なりにどうやって追随していくのかが甚だ不安になります。

シンボルの衝突も含めて、プリプロセッサマクロでmathn版と組み込み版を切り
替えてコンパイルするようにパッチを書いてみました。
基本的には石塚さんの変更を組み込みクラスのほうにマージして、その上で切り
替え用マクロを足したものです。添付します。

ふなばさんも、プリプロセッサマクロで切り替える程度は許していただけないで
しょうか。
Unify定数で挙動が左右されるというのは異様だとしても、ソースコードレベル
で切り替えるならば違和感は少ないかと思います。parse.yのripper対応の前例
もありますし。

実際の処ripperのように、添付ライブラリは拡張ライブラリの中でもある程度の
Ruby本体のサポートを期待して良い地位にあります。また、石塚さんがおっ
しゃっているようにmathnの振る舞いは、互換性を除けばRubyの将来的な数値の
振る舞いとして結構望ましいものであって、その実験実装という意味合いもあり
ますから。

というあたりでこのパッチで落としどころになりませんでしょうか。

e$B$1$$$8$e!w$$$7$D$+$G$9e(B.

In [ruby-dev :36926 ] the message: "[ruby-dev:36926] Re:
{Complex,Rational}::Unify ", on Oct/25 15:00(JST) “Yugui (Yuki
Sonoda)” writes:

Yuguie$B$G$9!#e(B

e$B$H!"$9$k$HBgI}$J=EJ#Dj5A$O$d$`$rF@$^$;$s!#$7$+$7!":#8e$NAH$9~$%/%i%9$Ne(B
e$B$[$&$N2~A1$J$j2?$J$j$K$I$&$d$C$FDI?o$7$F$$$/$N$+$,?S$@IT0B$K$J$j$^$9!#e(B

e$B3N$Ke(B, e$B$=$l$OA4$/H]Dj$7$^$;$se(B.

e$B%7%s%%k$N>WFM$b4^$a$F!"%W%j%W%m%;%C%5%^%/%m$Ge(Bmathne$BHG$HAH$_9~$HG$r@Z$je(B
e$BBX$($F%3%s%Q%$%k$9$k$h$&$K%Q%C%A$r=q$$$F$
$^$7$?!#e(B
e$B4pK\E*$K$O@PDM$5$s$NJQ99$rAH$9~$%/%i%9$N$[$&$K%^!<%8$7$F!"$=$N>e$G@Z$je(B
e$BBX$(MQ%^%/%m$rB-$7$?$b$N$G$9!#E:IU$7$^$9!#e(B

e$B:#2s$Oe(B, e$B;~4V$N4X78$b$"$je(B,
e$B;d$NJ}$+$i$O$=$N$h$&$JDs0F$O$7$F$$$^$;$s$G$$e(B
e$B$?$,e(B, e$B<B:]$K$Oe(B,
e$B$=$&$$$&J}8~$,K>$^$7$$$H$H9M$($F$$$^$9e(B. e$B;d$NJ}$H$7$Fe(B
e$B$be(B, e$B$3$NMM$K$7$F$$$?$@$1$k$J$i$"$j$,$?$$$G$9e(B.

e$B$=$l$H$OOC$OJQ$o$j$^$9$,e(B, Yuguie$B$5$s$N0F$G$Oe(B,

ext/mathn/rational/rational.c
ext/mathn/complex/complex.c

e$B$Oe(B,

#define EXT_MATHN
#define CANON
#include “…/…/…/complex.c”

e$B$J46$8$N%3!<%I$H$7$F;D$C$F$$$^$9$,e(B, e$B$$$C$=$&$N$3$H:o=|$7$Fe(B,
extconf.rb
e$B$G2<5-$N$h$&$J%3!<%I$re(B Makefile
e$B$KDI2C$G@8@.$9$k$h$&$K$7$?J}$,$h$$$H;W$Ce(B
e$B$F$$$^$9e(B.

complex.c: …/…/…/complex.c
@cp -p $^ $@

e$B$9$$$^$;$se(B. e$B;~4V$N4X78$G%F%9%H$O$7$F$$$^$;$se(B.

__
---------------------------------------------------->> e$B@PDMe(B
e$B7=<ye(B <<—
---------------------------------->> e-mail: [email protected] <<—

e$B$J$+$@$G$9!#e(B

At Sun, 26 Oct 2008 02:36:02 +0900,
keiju ISHITSUKA wrote in [ruby-dev:36929]:

e$B$J46$8$N%3!<%I$H$7$F;D$C$F$$$^$9$,e(B, e$B$$$C$=$&$N$3$H:o=|$7$Fe(B, extconf.rb
e$B$G2<5-$N$h$&$J%3!<%I$re(B Makefile e$B$KDI2C$G@8@.$9$k$h$&$K$7$?J}$,$h$$$H;W$Ce(B
e$B$F$$$^$9e(B.

complex.c: …/…/…/complex.c
@cp -p $^ $@

$^e$B$Oe(Bmakee$B$K$h$C$F;H$($?$j;H$($J$+$C$?$j0UL#$,0c$C$?$j$7$^$9!#e(B
yuguie$B$5$s$N0F$N$[$&$,$$$$$H;W$$$^$9!#e(B

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:36926] Re: {Complex,Rational}::Unify”
on Oct.25,2008 15:00:51, [email protected] wrote:

e$B%7%s%%k$N>WFM$b4^$a$F!"%W%j%W%m%;%C%5%^%/%m$Ge(Bmathne$BHG$HAH$_9~$HG$r@Z$je(B
e$BBX$($F%3%s%Q%$%k$9$k$h$&$K%Q%C%A$r=q$$$F$
$^$7$?!#e(B

yuguie$B$5$s$N%Q%C%A$=$N$^$^$G$O2r7h$7$F$J$$$h$&$@$C$?$N$G!"$=$Ne(B
e$BB>Hy:Y$J=$@5$b2C$($Fe(Byuguie$B$5$s$N%Q%C%A$X$N:9J,$r:n$j$^$7$?!#e(B
e$B6qBNE*$K$Oe(B

rb_cComplexe$B!"e(Brb_cRationale$B$Oe(Bruby.he$B$Ge(Bexterne$B$5$l$F$k$N$Ge(B.ce$BB&e(B
e$B$G@k8@<+BN$,ITMWe(B(e$B$H$$$&$+<YKbe(B)e$B$J$N$GK\BNB&$NDj5A$N$_;D$7e(B
e$B$Fe(Bexte$BB&$N@k8@$r:o=|!#e(B

exte$BB&$Ne(B.ce$B$OK\BNB&$Ne(B.ce$B$K0MB8$7$F$k$N$Ge(Bdepende$B$rDI2C!#e(B

  • complex.c (rb_Complex) e$B$NLa$jCMJV$7K:$l$r=$@5!#e(B

e$B$G$9!#e(B

— complex.c.orig 2008-10-27 09:29:07.440873000 +0900
+++ complex.c 2008-10-27 09:33:48.840873200 +0900
@@ -20,8 +20,7 @@
#define TWO INT2FIX(2)

-#ifdef EXT_MATHN
-extern
-#endif
+#ifndef EXT_MATHN
VALUE rb_cComplex;
+#endif

static ID id_abs, id_abs2, id_arg, id_cmp, id_conj, id_convert,
@@ -983,5 +982,5 @@ VALUE
rb_Complex(VALUE x, VALUE y)
{

  • rb_funcall(rb_cComplex, id_convert, 2, x, y);
  • return rb_funcall(rb_cComplex, id_convert, 2, x, y);
    }
    #endif
    — rational.c.orig 2008-10-27 09:36:57.654873000 +0900
    +++ rational.c 2008-10-27 09:37:11.544873200 +0900
    @@ -25,8 +25,7 @@
    #define TWO INT2FIX(2)

-#ifdef EXT_MATHN
-extern
-#endif
+#ifndef EXT_MATHN
VALUE rb_cRational;
+#endif

static ID id_abs, id_cmp, id_convert, id_equal_p, id_expt, id_floor,
— /dev/null 2006-12-01 09:00:00.000000000 +0900
+++ ext/mathn/complex/depend 2008-10-27 09:36:04.195873200 +0900
@@ -0,0 +1 @@
+complex.o: …/…/…/complex.c
— /dev/null 2006-12-01 09:00:00.000000000 +0900
+++ ext/mathn/rational/depend 2008-10-27 09:36:32.940873200 +0900
@@ -0,0 +1 @@
+rational.o: …/…/…/rational.c

e$B$=$l$G$O!#e(B

e$B:#F|Cf$K$U$J$P$5$s$+$iH?BP$,$J$1$l$P:#2s$N%j%j!<%9$O$3$l$G9T$-$^$7$g$&!#e(B

e$BH?BP$G$9!#e(B

e$B8=>u$NFbMF$,$I$&$G$"$l!“AH$9~$$KD>@$O6A$+$J$$$7!”$^$D$b$H$5$s!“e(B
yugui e$B$5$s$,G’$a$F$$$k$N$G!”$=$l$K$OJ86g$O$$$o$J$$$3$H$K$7$^$9!#e(B

e$B$J$N$G8=>u$N$^$^$K$7$F$$/$+!"$"$k$$$O!"M=A[30$KFbMF$,$R$I$/$F!"7k2LEe(B
e$B$Ke(B yugui
e$B$5$s$NH=CG$,E,Ev$G$J$+$C$?$H$$$&$N$G$"$l$P!"$3$N;~4|$H$7$F$O!"e(B
e$BM&5$$r;}$C$F@PDM$5$s$N=$@5<+BN$r<h$j>C$9$N$OBEEv$JH=CG$@$H;W$$$^$9!#M=e(B
e$B$a!“Dy$a@Z$j$OJ,$+$C$F$$$?$3$H$J$N$G!”@PDM$5$s$bG<F@$5$l$k$N$8$c$J$$$Ge(B
e$B$7$g$&$+!#e(B

Yuguie$B$G$9!#e(B

Tadayoshi F. e$B$5$s$O=q$-$^$7$?e(B:

e$B:#F|Cf$K$U$J$P$5$s$+$iH?BP$,$J$1$l$P:#2s$N%j%j!<%9$O$3$l$G9T$-$^$7$g$&!#e(B

e$BH?BP$G$9!#e(B

e$BN;2r$7$^$7$?!#e(B$(srcdir)/{rational,complex}.c
e$B$X$N%^!<%8$OCf;_$7$^$7$?!#e(B
e$B$7$+$7$J$,$i!"e(Bmathne$B$,2u$l$?>uBV$b%j%j!<%9$K:9$7;Y$($^$9$N$G!"e(Busae$B$5$s$K$*e(B
e$B4j$$$7$Fe(Bext/mathn/{rational,complex}/
e$B$N$[$&$r=$@5$7$F$b$i$$$^$7$?!#e(B

Ruby 1.9.1 Preview
1e$B$O$3$N>uBV$G%j%j!<%9$7$^$9!#$3$N%j%j!<%9$N$"$H!"e(BRuby
1.9.1e$B@5<0HG$r%j%j!<%9$9$k$^$G$K!"e(B

  • complexe$B$He(Brationale$B$NKd$a9~$_$O0];}$9$k$3$He(B
  • mathne$B$,e(Bmathne$B$H$7$F@5$7$/?6$kIq$&$3$He(B
  • e$B;}B3E*$J%a%s%F%J%s%9$,2DG=$J<BAu$G$"$k$3$He(B

e$B$r$9$Y$FK~$?$9$h$&$J2r7h:v$rC5$C$FM_$7$$$H;W$$$^$9!#$3$l$,IT2DG=$J>l9g$Oe(B

  • mathne$B$rI8=`%i%$%V%i%j$+$i30$9e(B
  • complex, rationale$B$NKd$a9~$_$r$d$a$ke(B
    e$B$N$$$:$l$+$,I,MW$K$J$k$G$7$g$&!#$I$A$i$b$H$F$bK>$^$7$/$J$$$3$H$@$H;W$$$^$9!#e(B

e$B$1$$$8$e!w$$$7$D$+$G$9e(B.

e$B$"$^$j5DO@$7$F$$$k2K$b$J$5$=$&$J$N$Ge(B, e$B;d$N7kO@$@$1e(B.

e$B$U$J$P$5$s$,e(B(e$B;CDjE*$K$G$be(B)e$B<u$1F~$l2DG=$J0F$H$7$F=P$7$F$$$?$@$$$?e(B,

void nurat_canonicalize(int) e$B$N$h$&$J4X?t$rMQ0U$7$F!"e(B

nurat_canonicalize(1);

e$B$H$9$l$P!"@55,2=$5$l$k!"$H$$$&$N$G$b$$$$$H;W$$$^$9!#e(B

e$B$K$N$i$5$;$F$$$?$@$-$?$$$H;W$$$^$9e(B. e$B$?$V$se(B, e$B$3$l$,e(B
Yugui e$B$5$s$N4+9p$re(B
e$BK~$?$9:#$N$H$3$m$N%Y%9%H$J2r7h:v$@$H;W$$$^$9e(B.

rational.c, complex.c, mathn/* e$BF1;~$K%A%’%C%/%$%s$,K>$^$7$$$N$Ge(B,
e$B$U$Je(B
e$B$P$5$s$NJ}$G%A%’%C%/%$%s$7$F$$$?$@$1$^$;$s$+e(B?

ruby2.0e$B$X$K8~$1$F$ND94|E*$JOC$Oe(B, e$B$^$?e(B,
e$BOC$79g$$$7$^$7$g$&e(B.

In [ruby-dev :36961 ] the message: "[ruby-dev:36961] Re:
{Complex,Rational}::Unify ", on Oct/28 02:40(JST) Tadayoshi F.
writes:

e$B$I$&$b@PDM$5$s$NOC$O0l4S@-$,$J$$$7!"2?$r?.$8$F$$$$$N$+!"2?$r$7$?$$$N$+e(B
e$B$D$+$a$J$$$s$G$9$h$M!#e(B

Unify e$B$rDj5A$9$k$N$b$"$k0UL#%O%C%-%j$7$F$$$k$H;W$$$^$9$,!"e(B

e$B0l1~%Q%C%A$r:n$j$^$7$?!#$3$N>l9g!"3HD%%i%$%V%i%j$G!"e(Bcomplex.ce$B!"e(B
rational.c e$B$rJ,$1$kI,MW$O$J$$$G$9$,!#e(B
__
---------------------------------------------------->> e$B@PDMe(B
e$B7=<ye(B <<—
---------------------------------->> e-mail: [email protected] <<—

Yuguie$B$G$9!#e(B

U.Nakamura e$B$5$s$O=q$-$^$7$?e(B:

In message “[ruby-dev:36926] Re: {Complex,Rational}::Unify”
on Oct.25,2008 15:00:51, [email protected] wrote:

e$B%7%s%%k$N>WFM$b4^$a$F!"%W%j%W%m%;%C%5%^%/%m$Ge(Bmathne$BHG$HAH$_9~$HG$r@Z$je(B
e$BBX$($F%3%s%Q%$%k$9$k$h$&$K%Q%C%A$r=q$$$F$
$^$7$?!#e(B

yuguie$B$5$s$N%Q%C%A$=$N$^$^$G$O2r7h$7$F$J$$$h$&$@$C$?$N$G!"$=$Ne(B
e$BB>Hy:Y$J=$@5$b2C$($Fe(Byuguie$B$5$s$N%Q%C%A$X$N:9J,$r:n$j$^$7$?!#e(B

e$B:#F|Cf$K$U$J$P$5$s$+$iH?BP$,$J$1$l$P:#2s$N%j%j!<%9$O$3$l$G9T$-$^$7$g$&!#e(B
e$B62$lF~$j$^$9$,!":#F|MM;R$r$$F!"%3%%C%H$r$*4j$$$G$-$^$9$+!#e(B <
e$B$J$+$`$i$5$se(B