ComplexFloat

村田です.

C99 の double _Complex をラップした ComplexFloat を実装しました.
Rev 15910 に対する patch を添付します.

サイズがデカいと fml に怒られたので gzip しました.

「C99 の double _Complex をラップした」と書きましたが,
Ruby は C99 を要求していないはずなので,configure --with-c99-complex することで
double _Complex を使うようにしています.–with-c99-complex ãŒæŒ‡å®šã•ã‚Œã¦ã„ãªã„å ´åˆã¯ï¼Œ
double _Complex ã¨åŒä¸€ãƒ¬ã‚¤ã‚¢ã‚¦ãƒˆã®æ§‹é€ ä½“ã‚’ä½¿ç”¨ã—ã¾ã™ï¼Ž

ComplexFloat::Math モジュールには,C99 ã§è¿½åŠ ã•ã‚ŒãŸè¤‡ç´ æ•°ç”¨é–¢æ•°ã®ãƒ©ãƒƒãƒ‘ã‚’å®šç¾©ã—ã¦ã„ã¾ã™ï¼Ž
ã“ã®è¤‡ç´ æ•°ç”¨é–¢æ•°ã‚‚ï¼Œ–with-c99-complex が指定されなければ互換性がある(はず)の独自実装を使います.

Complex 組み込みのスレッドでは僕の意図がきちんと伝わらず,
話が変な方に行ってしまい残念な思いをしたので,実装で意図を示す事にしました.
complex.rb で提供れていた Complex が組み込みで提供されるなら,
ã“ã†ã„ã†å®Ÿè£…ã®è¤‡ç´ æ•°ãŒçµ„ã¿è¾¼ã¿ã§æä¾›ã•ã‚Œã¦ã„ã¦ã‚‚è‰¯ã„ã¨æ€ã„ã¾ã™ãŒã©ã†ã§ã—ã‚‡ã†ï¼Ÿ

私の希望としては,ふなばさんの Complex と僕の ComplexFloat を両方組み込みで提供してもらいたいです.
ふなばさんの Complex ã¯å¤šå€é•·å›ºå®šå°æ•°ç‚¹æ•°ãªã©ã‚’ä½¿ç”¨ã™ã‚‹å ´åˆã«å¿…è¦ã«ãªã‚Šã¾ã™ï¼Ž
私の ComplexFloat ã¯æ‹¡å¼µãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã§è¨ˆç®—ãƒ«ãƒ¼ãƒãƒ³ã‚’æ›¸ãå ´åˆã«ä½¿ã„æ˜“ã„å®Ÿè£…ã«ãªã£ã¦ã‚‹ã¯ãšã§ã™ï¼Ž
そして,できれば Complex <-> ComplexFloat 間の変換を Rational,Integer <-> Float 間の変換と
同じようなルールにすべきかなと考えています (まだなってない).

e$BB<ED$G$9!%e(B

2008/4/6 Kenta M. [email protected]:

C99 e$B$Ne(B double _Complex e$B$r%i%C%W$7$?e(B ComplexFloat e$B$r<BAu$7$^$7$?!%e(B
Rev 15910 e$B$KBP$9$ke(B patch e$B$rE:IU$7$^$9!%e(B

e$B%5%$%:$,%G%+$$$He(B fml e$B$KE$i$l$?$N$Ge(B gzip e$B$7$^$7$?!%e(B

e$B$*K;$7$$$+$H;W$$$^$9$,!$e(Bpatch
e$B$KBP$9$k%3%a%s%H$rD:$1$^$;$s$+!)e(B
e$B:NMQ$G$-$J$$$H$$$&$3$H$J$i!$$G$-$l$P$=$NM}M3$b65$([email protected]$-$?$$$G$9!%e(B
e$B?7$7$/F3F~$7$?4X?t$NL>A0$,[email protected]$,2DG=$JM}M3$G$7$?$i!$e(B
[email protected]$r;$7$?e(B patch e$B$r:n$jD>$7$^$9!%e(B

e$B$h$m$7$/$*4j$$$7$^$9!%e(B

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

In message “Re: [ruby-dev:34280] Re: ComplexFloat”
on Thu, 10 Apr 2008 15:34:09 +0900, “Kenta M.”
[email protected] writes:

|2008/4/6 Kenta M. [email protected]:
|> C99 e$B$Ne(B double _Complex e$B$r%i%C%W$7$?e(B ComplexFloat e$B$r<BAu$7$^$7$?!%e(B
|> Rev 15910 e$B$KBP$9$ke(B patch e$B$rE:IU$7$^$9!%e(B
|> # e$B%5%$%:$,%G%+$$$He(B fml e$B$KE$i$l$?$N$Ge(B gzip e$B$7$^$7$?!%e(B
|
|e$B$*K;$7$$$+$H;W$$$^$9$,!$e(Bpatch e$B$KBP$9$k%3%a%s%H$rD:$1$^$;$s$+!)e(B
|e$B:NMQ$G$-$J$$$H$$$&$3$H$J$i!$$G$-$l$P$=$NM}M3$b65$([email protected]$-$?$$$G$9!%e(B

e$B;d<+?H$OJ#AG?t$r;H$&5!2q$,$J$$$N$G!"$G$-$,NI$$$H$+0-$$$H$+H=e(B
e$BJL$9$k$3$H$O$G$-$J$$$N$G$9$,!"e(BComplexFloate$B$He(BComplexe$B$NN>J}$rDse(B
e$B6!$9$k$N$O!"e(BRubye$BE*$K$I$&$J$N$+5?Ld$r46$8$F$$$k$H$$$&$,@5D>$Je(B
e$B$H$3$m$G$9!#e(B

[email protected]$G$-$J$$$H$3$m$G0z$C$+$+$C$F$7$^$C$F$$$k$N$,?=$7Lue(B
e$B$J$$$H$3$m$G$9$,!#e(B

e$B$`$i$?$G$9!%e(B

e$B%3%a%s%H$"$j$,$H$&$4$6$$$^$9!%e(B

2008/4/10 Yukihiro M. [email protected]:

e$B;d<+?H$OJ#AG?t$r;H$&5!2q$,$J$$$N$G!"$G$-$,NI$$$H$+0-$$$H$+H=e(B
e$BJL$9$k$3$H$O$G$-$J$$$N$G$9$,!"e(BComplexFloate$B$He(BComplexe$B$NN>J}$rDse(B
e$B6!$9$k$N$O!"e(BRubye$BE*$K$I$&$J$N$+5?Ld$r46$8$F$$$k$H$$$&$,@5D>$Je(B
e$B$H$3$m$G$9!#e(B

Ruby e$B$O:#8e$be(B C99 e$B$Ne(B complex.h
e$B$rAH$9~$%/%i%9e(B/e$B%b%8%e!<%k$G$Oe(B
e$B%5%]!<%H$7$J$$$H2r<a$7$FNI$$$G$9$+!)e(B

Math e$B%b%8%e!<%k$,e(B math.h e$B$Ne(B wrapper
e$B$G$"$k$H6D$C$F$*$j$^$7$?$,!$e(B
complex.h e$B$K4^$^$l$kJ#AG4X?t$be(B C99
e$B$HF1$8;EMM$N$b$N$,Ds6!$5$l$ke(B
e$B$3$H$OJ]>Z$5$l$J$$$H2r<a$7$FNI$$$G$9$+!)e(B

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

In message “Re: [ruby-dev:34283] Re: ComplexFloat”
on Thu, 10 Apr 2008 16:31:27 +0900, “Kenta M.”
[email protected] writes:

|2008/4/10 Yukihiro M. [email protected]:
|> e$B;d<+?H$OJ#AG?t$r;H$&5!2q$,$J$$$N$G!"$G$-$,NI$$$H$+0-$$$H$+H=e(B
|> e$BJL$9$k$3$H$O$G$-$J$$$N$G$9$,!"e(BComplexFloate$B$He(BComplexe$B$NN>J}$rDse(B
|> e$B6!$9$k$N$O!"e(BRubye$BE*$K$I$&$J$N$+5?Ld$r46$8$F$$$k$H$$$&$,@5D>$Je(B
|> e$B$H$3$m$G$9!#e(B
|
|Ruby e$B$O:#8e$be(B C99 e$B$Ne(B complex.h e$B$rAH$9~$%/%i%9e(B/e$B%b%8%e!<%k$G$Oe(B
|e$B%5%]!<%H$7$J$$$H2r<a$7$FNI$$$G$9$+!)e(B

e$B$=$&7h$a$F$$$k$N$G$"$l$P!"!V5?Ld$r46$8$F$$$k!W$H$$$&$h$&$J[#e(B
[email protected]$$J}$G$J$/!"$b$&$A$g$C$H$O$C$-$j$7$?I=8=$r;H$$$^$9!#MWe(B
e$B$9$k$K!VL>A0$HMQES$,;w$F$$$k$,0c$&$U$?$D$N%/%i%9$,$"$k>l9g!"e(B
e$B$-$A$s$H=;$_J,$1$k$?$a$KG[N8$,I,MW!#e(BComplexFloate$B$H$$$&L>A0$,e(B
e$B=;$_J,$1$N$?$a:GA1$+$I$&$+e(B(e$B$^[email protected](B)e$B<+?.$,$J$$!W$H$$$&%l%Y%k$G$9!#e(B

|Math e$B%b%8%e!<%k$,e(B math.h e$B$Ne(B wrapper e$B$G$"$k$H6D$C$F$*$j$^$7$?$,!$e(B
|complex.h e$B$K4^$^$l$kJ#AG4X?t$be(B C99 e$B$HF1$8;EMM$N$b$N$,Ds6!$5$l$ke(B
|e$B$3$H$OJ]>Z$5$l$J$$$H2r<a$7$FNI$$$G$9$+!)e(B

e$B>e5-$HF1MM$K!":#$9$0$=$N$^$^F3F~$5$l$k$3$H$O$J$$$H;W$$$^$9$,!"e(B
e$B>-Mh$KEO$C$FF3F~$7$J$$$H7h$a$F$$$k$o$1$G$O$J$$$G$9!#e(BRubye$B$N4pe(B
e$BK;EMM$,$+$J$je(BCe$B$K0z$-$:$i$l$F$$$ke(B(e$B?t3XA4HL$G$O$J$/e(Blibme$B$N$?$ae(B
e$B$Ke(BMathe$B$H$$$&L>A0$r;H$C$?$je(B)e$B$3$H$r9M$($k$H!"F3F~$,$^$C$?$/$"e(B
e$B$j$($J$$OC$H$$$&$o$1$G$O$J$$$H;W$$$^$9!#e(B

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

[email protected]$G$9!#e(B

At Thu, 10 Apr 2008 15:34:09 +0900,
Kenta M. wrote in [ruby-dev:34280]:

C99 e$B$Ne(B double _Complex e$B$r%i%C%W$7$?e(B ComplexFloat e$B$r<BAu$7$^$7$?!%e(B
Rev 15910 e$B$KBP$9$ke(B patch e$B$rE:IU$7$^$9!%e(B

e$B%5%$%:$,%G%+$$$He(B fml e$B$KE$i$l$?$N$Ge(B gzip e$B$7$^$7$?!%e(B

e$B$*K;$7$$$+$H;W$$$^$9$,!$e(Bpatch e$B$KBP$9$k%3%a%s%H$rD:$1$^$;$s$+!)e(B
e$B:NMQ$G$-$J$$$H$$$&$3$H$J$i!$$G$-$l$P$=$NM}M3$b65$([email protected]$-$?$$$G$9!%e(B

e$BAH9~$_$G$"$kI,[email protected]$,$h$/$o$+$j$^$;$s$G$7$?!#e(B

e$B$^$?!“e(Blong=32bit,double=64bite$B$N4D6-$G$O!“A4e(BVALUEe$B$,e(B1worde$BBg$-$/$Je(B
e$B$j$^$9!#$*$=$i$/$[$H$s$I$N?M4V$,;H$&$3$H$,$J$$$G$”$m$&5!G=$KJ’$&e(B
e$BBe=~$H$7$F$O!”$$$5$5$+Bg$-$9$.$k$h$&$J!#e(B

e$B$`$i$?$G$9!%e(B

2008/4/10 Nobuyoshi N. [email protected]:

e$B$^$?!“e(Blong=32bit,double=64bite$B$N4D6-$G$O!“A4e(BVALUEe$B$,e(B1worde$BBg$-$/$Je(B
e$B$j$^$9!#$*$=$i$/$[$H$s$I$N?M4V$,;H$&$3$H$,$J$$$G$”$m$&5!G=$KJ’$&e(B
e$BBe=~$H$7$F$O!”$$$5$5$+Bg$-$9$.$k$h$&$J!#e(B

VALUE e$B$N%5%$%:$,A}2C$9$k$3$H$K$O5$IU$$$F$$$^$;$s$G$7$?!%e(B
e$B$4;XE&$"$j$,$H$&$4$6$$$^$9!%3N$+$K!$e(BComplexFloat
e$B$N<{MW$r9M$($k$H!$e(B
e$B$3$l$OBg$-$JBe=~$K$J$j$^$9$M!%e(B
e$B$7$+$7!$$3$NBe=~$Oe(B rb_double_complex e$B$re(B VALUE
e$B$KKd$a9~$^$:$Ke(B
e$B%]%$%s%?$G;}$D$h$&$K$9$l$P2r7h$G$-$^$9$h$M!)e(B

e$B$=$l$+$i!$AH$9~$$K$9$kI,[email protected]$r46$8$J$$$H$N$3$H$G$9$,!&!&!&e(B
Complex e$B$O!$<BIt$H5uIt$,N>J}e(B Float
e$B$K$J$k$H!$$=$NCM$H$N1i;;[email protected]@.$5$l$ke(B
e$B$9$Y$F$Ne(B Complex e$B%*%V%8%’%/%H$N<BIt$H5uIt$Oe(B Float
e$B$G$9!%e(B
e$B<BIt$H5uIt$,N>J}6&e(B Float e$B$G$"$k>l9g!$$=$l$i$re(B VALUE
e$B$G;}$D$h$j$be(B
(e$B$b$7;H$($k$J$ie(B) double _Complex e$B$GI=8=$7$Fe(B C99
e$B$NJ#AG4X?t$de(B
e$BJ#AG?t7W;;$r;H$&$Y$-$G$O$J$$$+$H;W$$$^$;$s$+!)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:34288] Re: ComplexFloat”
on Apr.10,2008 17:09:20, [email protected] wrote:

e$B$=$l$+$i!$AH$9~$$K$9$kI,[email protected]$r46$8$J$$$H$N$3$H$G$9$,!&!&!&e(B
Complex e$B$O!$<BIt$H5uIt$,N>J}e(B Float e$B$K$J$k$H!$$=$NCM$H$N1i;;[email protected]@.$5$l$ke(B
e$B$9$Y$F$Ne(B Complex e$B%*%V%8%’%/%H$N<BIt$H5uIt$Oe(B Float e$B$G$9!%e(B
e$B<BIt$H5uIt$,N>J}6&e(B Float e$B$G$"$k>l9g!$$=$l$i$re(B VALUE e$B$G;}$D$h$j$be(B
(e$B$b$7;H$($k$J$ie(B) double _Complex e$B$GI=8=$7$Fe(B C99 e$B$NJ#AG4X?t$de(B
e$BJ#AG?t7W;;$r;H$&$Y$-$G$O$J$$$+$H;W$$$^$;$s$+!)e(B

e$BC1$Ke(BRDatae$B$r;H$C$F3HD%%i%$%V%i%j$G$$$$$N$G$O!"$H$$$&$N$,[email protected](B
e$B$5$s$N;XE&[email protected]$H;W$$$^$9!#e(B
e$B$=$&[email protected]$1$G!“e(BVALUEe$B$N%5%$%:$NLdBj$H!”<BBN$re(Bdouble _Complex
e$B$GI=8=$9$k$3$H$HN>J}$,<B8=$G$-$k$H;W$&$N$G$9$,!"$=$&$;$:$KK\e(B
e$BBN$X$NAH$9~$$K$7$J$$$H$$$1$J$$M}M3$O$J$s$G$7$g$&$+e(B?

e$BJL$KH?BP$7$F$k$o$1$8$c$J$$$s$G$9$1$I$Me(B

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

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

In message “Re: [ruby-dev:34288] Re: ComplexFloat”
on Thu, 10 Apr 2008 17:09:20 +0900, “Kenta M.”
[email protected] writes:

|VALUE e$B$N%5%$%:$,A}2C$9$k$3$H$K$O5$IU$$$F$$$^$;$s$G$7$?!%e(B
|e$B$4;XE&$"$j$,$H$&$4$6$$$^$9!%3N$+$K!$e(BComplexFloat e$B$N<{MW$r9M$($k$H!$e(B
|e$B$3$l$OBg$-$JBe=~$K$J$j$^$9$M!%e(B
|e$B$7$+$7!$$3$NBe=~$Oe(B rb_double_complex e$B$re(B VALUE e$B$KKd$a9~$^$:$Ke(B
|e$B%]%$%s%?$G;}$D$h$&$K$9$l$P2r7h$G$-$^$9$h$M!)e(B

e$B$=$NLdBj$O2r7h$7$^$9$M!#e(B

|e$B$=$l$+$i!$AH$9~$$K$9$kI,[email protected]$r46$8$J$$$H$N$3$H$G$9$,!&!&!&e(B
|Complex e$B$O!$<BIt$H5uIt$,N>J}e(B Float e$B$K$J$k$H!$$=$NCM$H$N1i;;[email protected]@.$5$l$ke(B
|e$B$9$Y$F$Ne(B Complex e$B%*%V%8%’%/%H$N<BIt$H5uIt$Oe(B Float e$B$G$9!%e(B
|e$B<BIt$H5uIt$,N>J}6&e(B Float e$B$G$"$k>l9g!$$=$l$i$re(B VALUE e$B$G;}$D$h$j$be(B
|(e$B$b$7;H$($k$J$ie(B) double _Complex e$B$GI=8=$7$Fe(B C99 e$B$NJ#AG4X?t$de(B
|e$BJ#AG?t7W;;$r;H$&$Y$-$G$O$J$$$+$H;W$$$^$;$s$+!)e(B

e$B$=$l$O<[email protected]$HG’<1$7$F$$$^$9!#N>J}$H$be([email protected]$C$?e(B
e$B$iFbItE*$Ke(Bcomplexe$B$r:n$C$Fe(BC99e$B$N4X?t$r8F$Y$P$h$$$H$$$&$N$b$R$He(B
e$B$D$N9M$(J}$G$9$+$i!#e(B

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

e$B$`$i$?$G$9!%e(B

2008/4/10 U.Nakamura [email protected]:

e$BC1$Ke(BRDatae$B$r;H$C$F3HD%%i%$%V%i%j$G$$$$$N$G$O!"$H$$$&$N$,[email protected](B
e$B$5$s$N;XE&[email protected]$H;W$$$^$9!#e(B

e$B$=$l$O==J,>5CN$7$F$$$^$9!%3HD%%i%$%V%i%j$O8D?ME*$K;H$C$F$$$k$b$N$Ge(B
e$B4{$K;}$C$F$$$k$N$G!$$=$l$GNI$$$J$ie(B ruby-dev
e$B$K%a!<%k$OAw$j$^$;$s!%e(B

e$B$=$&[email protected]$1$G!“e(BVALUEe$B$N%5%$%:$NLdBj$H!”<BBN$re(Bdouble _Complex
e$B$GI=8=$9$k$3$H$HN>J}$,<B8=$G$-$k$H;W$&$N$G$9$,!"$=$&$;$:$KK\e(B
e$BBN$X$NAH$9~$$K$7$J$$$H$$$1$J$$M}M3$O$J$s$G$7$g$&$+e(B?

Ruby e$B$Ke(B C99 e$B$Ne(B complex.h
e$B$rAH$9~$$G%5%]!<%H$5$;$?$$$H$$$&A[$$$H!$e(B
e$B8=>u$Ne(B Complex e$B$X$N<c43$NITK~$G$9$+$M$’!%e(B

ComplexFloat (e$B2>>Ne(B) e$B$,AH9~$_$G%5%]!<%H$5$l$k$H!$e(B

(1) TYPE(obj) == T_COMPLEX_FLOAT e$B$G7?$rD4$Y$k$3$H$,$G$-$ke(B
(2) T_COMPLEX_FLOAT e$B$G$"$kJ#AG?t$O<BIt$b5uIt$b3N<B$Ke(B
double e$B$G$"$k$3$H$,J]>Z$5$l$ke(B

e$B$H$$$&e(B2e$B$D$N4r$7$$;v$,$"$j$^$9!%$3$N;EMM$,<B8=$9$k$H$H$F$b2wE,$G$9!%e(B
e$B$=$7$F$3$l$i$N$&$Ae(B T_COMPLEX_FLOAT e$B$G7?$rD4$Y$k$3$H$Oe(B
e$B3HD%%b%8%e!<%k$G$O<B8=$G$-$J$$$G$9$7!$8=>u$Ne(B Complex
e$B$O<BIt$H5uIt$Ne(B
e$B7?$rKh2s5$$K$7$J$1$l$P$J$j$^$;$s!%$=$N$&$(!$JL$N%a!<%k$K=q$$$?$h$&$K!$e(B
e$BJ#[email protected],$,0lEYe(B Float
e$B$K$J$k$H!$$=$l$H$N1i;;[email protected]@.$5$l$kJ#AG?te(B
[email protected],$be(B Float e$B$G$9!%e(B

e$BKNIt$GC1=c$J5?Ld$J$N$G$9$,!"e(B

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

(1) TYPE(obj) == T_COMPLEX_FLOAT e$B$G7?$rD4$Y$k$3$H$,$G$-$ke(B

e$B%5%V%/%i%9:n$C$?;~$N5sF0$H$+$O$"$s$^$j9M$($J$$$C$F$3$H$G$7$g$&$+e(B?

e$B$`$i$?$G$9!%e(B

2008/4/10 U.Nakamura [email protected]:

[email protected]$$49$($k$H!"$b$74JC1$K7?$rF1Dj$G$-$kJL$NJ}K!$,$"$C$?$H$7$?e(B
e$B$i!"AH$9~$$G$J$/$F$b$$$$$s$G$7$g$&$+e(B?

e$B$4$a$s$J$5$$!%AH$9~$[email protected]$O$b$&0l$D$"$j$^$9!%e(B
e$B8=>u$Ne(B Complex e$B$r$$$8$C$F!$<BIt$H5uIt$,N>J}e(B Float
e$B$K$J$k$H$-$Ke(B
ComplexFloat e$B$rJV$9$h$&$J;EMM$K$G$-$^$9!%$3$&$9$k$He(B
Ruby e$B%9%/%j%W%H>e$G$Oe(B Complex e$B$He(B ComplexFloat
e$B$r6hJL$;$:$K;H$(!$e(B
C e$B>e$G$Oe(B TYPE(obj) e$B%^%/%m$r;H$&[email protected]$1$Ge(B Complex e$B$He(B
ComplexFloat e$B$re(B
e$B6hJL$7$F07$&$3$H$,2DG=$K$J$j$^$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:34293] Re: ComplexFloat”
on Apr.10,2008 17:40:29, [email protected] wrote:

(1) TYPE(obj) == T_COMPLEX_FLOAT e$B$G7?$rD4$Y$k$3$H$,$G$-$ke(B
(2) T_COMPLEX_FLOAT e$B$G$"$kJ#AG?t$O<BIt$b5uIt$b3N<B$Ke(B
double e$B$G$"$k$3$H$,J]>Z$5$l$ke(B

e$B$H$$$&e(B2e$B$D$N4r$7$$;v$,$"$j$^$9!%$3$N;EMM$,<B8=$9$k$H$H$F$b2wE,$G$9!%e(B
e$B$=$7$F$3$l$i$N$&$Ae(B T_COMPLEX_FLOAT e$B$G7?$rD4$Y$k$3$H$Oe(B
e$B3HD%%b%8%e!<%k$G$O<B8=$G$-$J$$$G$9$7!$8=>u$Ne(B Complex e$B$O<BIt$H5uIt$Ne(B
e$B7?$rKh2s5$$K$7$J$1$l$P$J$j$^$;$s!%$=$N$&$(!$JL$N%a!<%k$K=q$$$?$h$&$K!$e(B
e$BJ#[email protected],$,0lEYe(B Float e$B$K$J$k$H!$$=$l$H$N1i;;[email protected]@.$5$l$kJ#AG?te(B
[email protected],$be(B Float e$B$G$9!%e(B

(2)e$B$Oe(BComplexFloate$B$N$&$l$7$5$G$"$C$F!"$=$l$O7?$rF1Dj$G$-$F$5$(e(B
e$B$$$l$P!"AH$9~$[email protected]$m$&$,[email protected]$m$&$,4X78$J$$$G$9$h$M!#e(B
e$B$H$J$k$H!“AH$9~$$K$7$?$$$H$$$&OC$N>[email protected]$Oe(B(1)e$B$K=8Ls$5$l$F$$$k!“e(B
e$B$H$$$&$3$H$G$$$$$s$G$7$g$&$+e(B?
[email protected]$$49$($k$H!”$b$74JC1$K7?$rF1Dj$G$-$kJL$NJ}K!$,$”$C$?$H$7$?e(B
e$B$i!"AH$9~$$G$J$/$F$b$$$$$s$G$7$g$&$+e(B?

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

e$B$`$i$?$G$9!%e(B

2008/4/10 Urabe S. [email protected]:

e$BKNIt$GC1=c$J5?Ld$J$N$G$9$,!"e(B

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

(1) TYPE(obj) == T_COMPLEX_FLOAT e$B$G7?$rD4$Y$k$3$H$,$G$-$ke(B

e$B%5%V%/%i%9:n$C$?;~$N5sF0$H$+$O$"$s$^$j9M$($J$$$C$F$3$H$G$7$g$&$+e(B?

e$B$O$$!$$=$&$J$j$^$9!%AH$9~$$Ne(B Float
e$B$N<BAu$b$=$&$J$C$F$$$^$9$h$M!%e(B
e$BDs0F$7$?e(B patch e$B$Ne(B ComplexFloat (e$B2>>Ne(B) e$B$Oe(B Float
e$B$NJ#AG?tHG$N$h$&$Je(B
e$B0LCVIU$1$rA[Dj$7$F<BAu$7$^$7$?!%e(B

In article
[email protected],
“Kenta M.” [email protected] writes:

e$B$4$a$s$J$5$$!%AH$9~$[email protected]$O$b$&0l$D$"$j$^$9!%e(B
e$B8=>u$Ne(B Complex e$B$r$$$8$C$F!$<BIt$H5uIt$,N>J}e(B Float e$B$K$J$k$H$-$Ke(B
ComplexFloat e$B$rJV$9$h$&$J;EMM$K$G$-$^$9!%$3$&$9$k$He(B
Ruby e$B%9%/%j%W%H>e$G$Oe(B Complex e$B$He(B ComplexFloat e$B$r6hJL$;$:$K;H$(!$e(B
C e$B>e$G$Oe(B TYPE(obj) e$B%^%/%m$r;H$&[email protected]$1$Ge(B Complex e$B$He(B ComplexFloat e$B$re(B
e$B6hJL$7$F07$&$3$H$,2DG=$K$J$j$^$9!%e(B

e$B6hJL$7$J$$$J$i!“e(BComplex e$B$NFbIt$K%U%i%[email protected]_$1$F!”<B?t$H5u?t$He(B
e$BN>J}$,e(B Float e$B$J$iFbIt$N<BAu$re(B double _Complex e$B$J$$$7e(B
double
e$B$U$?$D$r$D$+$&$h$&$K$9$k$H$$$&$N$OFq$7$$$G$7$g$&$+!#e(B

e$B$`$i$?$G$9!%e(B

2008/4/10 Tanaka A. [email protected]:

e$B$U$?$D$r$D$+$&$h$&$K$9$k$H$$$&$N$OFq$7$$$G$7$g$&$+!#e(B
e$BNc$($Pe(B FL_COMPLEX_FLOAT
e$B$N$h$&$J%U%i%0$r;H$&$H$$$&$3$H$G$7$g$&$+!)e(B
e$B$=$l$O2DG=$G$9$7!$$=$N$h$&[email protected]$1$J$iFq$7$/$J$$$h$&$J5$$,$7$^$9!%e(B
e$B$5$i$K!$$=$N$h$&$KJQ99$7$F$be(B TYPE(obj)
e$B$r;H$&>l9g$H$[$H$s$IF1$8%3%9%H$Ge(B
e$B>uBV$r6hJL$G$-$^$9$M!%e(B
[email protected]$7!$JQ998e$Ne(B complex.c
e$B$N%a%s%F%J%s%9$OBgJQ$+$b$7$l$^$;$s!&!&!&e(B

e$B$`$i$?$G$9!%e(B

2008/4/10 Kenta M. [email protected]:

e$B6hJL$7$J$$$J$i!“e(BComplex e$B$NFbIt$K%U%i%[email protected]_$1$F!”<B?t$H5u?t$He(B
e$BN>J}$,e(B Float e$B$J$iFbIt$N<BAu$re(B double _Complex e$B$J$$$7e(B double
e$B$U$?$D$r$D$+$&$h$&$K$9$k$H$$$&$N$OFq$7$$$G$7$g$&$+!#e(B

e$BNc$($Pe(B FL_COMPLEX_FLOAT e$B$N$h$&$J%U%i%0$r;H$&$H$$$&$3$H$G$7$g$&$+!)e(B
e$B$=$l$O2DG=$G$9$7!$$=$N$h$&[email protected]$1$J$iFq$7$/$J$$$h$&$J5$$,$7$^$9!%e(B
e$B$5$i$K!$$=$N$h$&$KJQ99$7$F$be(B TYPE(obj) e$B$r;H$&>l9g$H$[$H$s$IF1$8%3%9%H$Ge(B
e$B>uBV$r6hJL$G$-$^$9$M!%e(B
[email protected]$7!$JQ998e$Ne(B complex.c e$B$N%a%s%F%J%s%9$OBgJQ$+$b$7$l$^$;$s!&!&!&e(B

e$B<B:]$K$=$N$h$&[email protected]$1$k$N$G$7$?$i!$;d$O%a%s%F%J%s%9$re(B
e$B$*<jEA$$$G$-$^$9!%e(B

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

In message “Re: [ruby-dev:34301] Re: ComplexFloat”
on Thu, 10 Apr 2008 18:36:13 +0900, “Kenta M.”
[email protected] writes:

|> e$B6hJL$7$J$$$J$i!“e(BComplex e$B$NFbIt$K%U%i%[email protected]_$1$F!”<B?t$H5u?t$He(B
|> e$BN>J}$,e(B Float e$B$J$iFbIt$N<BAu$re(B double _Complex e$B$J$$$7e(B double
|> e$B$U$?$D$r$D$+$&$h$&$K$9$k$H$$$&$N$OFq$7$$$G$7$g$&$+!#e(B
|
|e$BNc$($Pe(B FL_COMPLEX_FLOAT e$B$N$h$&$J%U%i%0$r;H$&$H$$$&$3$H$G$7$g$&$+!)e(B
|e$B$=$l$O2DG=$G$9$7!$$=$N$h$&[email protected]$1$J$iFq$7$/$J$$$h$&$J5$$,$7$^$9!%e(B
|e$B$5$i$K!$$=$N$h$&$KJQ99$7$F$be(B TYPE(obj) e$B$r;H$&>l9g$H$[$H$s$IF1$8%3%9%H$Ge(B
|e$B>uBV$r6hJL$G$-$^$9$M!%e(B

e$B$U$`!#Mn$H$7=j$,8+$($F$-$?$h$&$G$9$M!#e(B

|[email protected]$7!$JQ998e$Ne(B complex.c e$B$N%a%s%F%J%s%9$OBgJQ$+$b$7$l$^$;$s!&!&!&e(B

e$B$U$J$P$5$s$N0U8+$b$*J9$-$7$?$$$H$3$m$G$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:34298] Re: ComplexFloat”
on Apr.10,2008 18:21:45, [email protected] wrote:

e$B$4$a$s$J$5$$!%AH$9~$[email protected]$O$b$&0l$D$"$j$^$9!%e(B
e$B8=>u$Ne(B Complex e$B$r$$$8$C$F!$<BIt$H5uIt$,N>J}e(B Float e$B$K$J$k$H$-$Ke(B
ComplexFloat e$B$rJV$9$h$&$J;EMM$K$G$-$^$9!%$3$&$9$k$He(B
Ruby e$B%9%/%j%W%H>e$G$Oe(B Complex e$B$He(B ComplexFloat e$B$r6hJL$;$:$K;H$(!$e(B
C e$B>e$G$Oe(B TYPE(obj) e$B%^%/%m$r;H$&[email protected]$1$Ge(B Complex e$B$He(B ComplexFloat e$B$re(B
e$B6hJL$7$F07$&$3$H$,2DG=$K$J$j$^$9!%e(B

e$B$3$NOC$G!"!Ve(BComplexe$B$rAH$9~$$K$9$k$J$ie(BComplexFloate$B$b!W$H$$$&e(B
e$B%9%H!<%j!<$KG<[email protected]$7$^$7$?!#$J$k$[$I!#e(B

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

In article
[email protected],
“Kenta M.” [email protected] writes:

e$BNc$($Pe(B FL_COMPLEX_FLOAT e$B$N$h$&$J%U%i%0$r;H$&$H$$$&$3$H$G$7$g$&$+!)e(B
e$B$=$l$O2DG=$G$9$7!$$=$N$h$&[email protected]$1$J$iFq$7$/$J$$$h$&$J5$$,$7$^$9!%e(B
e$B$5$i$K!$$=$N$h$&$KJQ99$7$F$be(B TYPE(obj) e$B$r;H$&>l9g$H$[$H$s$IF1$8%3%9%H$Ge(B
e$B>uBV$r6hJL$G$-$^$9$M!%e(B
[email protected]$7!$JQ998e$Ne(B complex.c e$B$N%a%s%F%J%s%9$OBgJQ$+$b$7$l$^$;$s!&!&!&e(B

e$B$J$k$[$I!#$`$i$?$5$s$N4uK>$K$OJL$N%/%i%9$r:n$k$H$$$&$3$H$OF~$Ce(B
e$B$F$$$J$$$o$1$G$9$M!#e(B

e$B$G$O!"$$$^$N$^$^$Ne(B Complex e$B$G!"e(BC e$B%l%Y%k$Ge(B
Complex e$B$Je(B VALUE e$B$+$ie(B double _Complex
e$B$r<h$j=P$94X?t5Z$Se(B
double Complex e$B$+$ie(B Complex e$B$Je(B VALUE
[email protected]@[email protected]
$9e(B
e$B$k$H$$$&$N$J$i$I$&$G$7$g$&$+e(B?