Improving Fixnum#gcd(Fixnum)

 常に Integer#gcd(Integer) を使うのは遅いので Fixnum#gcd(Fixnum) を
用意すれば Rational を始めとして性能が大幅改善するよ、とのこと。

http://rubyforge.org/tracker/index.php?func=detail&aid=19034&group_id=426&atid=1698

どうでしょうか。

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

In message “Re: [ruby-dev:34116] Improving Fixnum#gcd(Fixnum)”
on Mon, 24 Mar 2008 21:24:22 +0900, “Akinori MUSHA”
[email protected] writes:

|e$B!!>o$Ke(B Integer#gcd(Integer) e$B$r;H$&$N$OCY$$$N$Ge(B Fixnum#gcd(Fixnum) e$B$re(B
|e$BMQ0U$9$l$Pe(B Rational e$B$r;[email protected]=$,BgI}2~A1$9$k$h!"$H$N$3$H!#e(B
|
|http://rubyforge.org/tracker/index.php?func=detail&aid=19034&group_id=426&atid=1698

1.9e$B$G$Oe(BRationale$B$OAH$9~$$K$J$C$F$^$k$4$He(BCe$B$G<BAu$5$l$F$$$^$9e(B
e$B$+$i$M$(!#e(BRationale$B0J30$Ge(Bgcde$B$r;H$&5!2q$C$F$I$N$/$i$$$"$k$s$Ge(B
e$B$7$g$&$+!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs