Yuguiã§ã™ã€‚
[ruby-dev:36294]ã«çµ¡ã‚“ã§ã€Vectorã¨Matrixã®ä»•æ§˜ã«ç–‘å•ãŒæ¹§ãã¾ã—ãŸã®ã§ç¢ºèª
ã•ã›ã¦ãã ã•ã„。
ç¾çŠ¶ã¾ã§Matrix#eql? 㨠Vector#eql? ã¯ãã‚Œãžã‚Œ == ã®ã‚¨ã‚¤ãƒªã‚¢ã‚¹ã§ã—ãŸ(ã“ã®
エイリアス作æˆã®typoãŒ[ruby-dev:36294]ã§ã—ãŸ)。
ã¨ã“ã‚ã§ã€eql?ãŒåŒå€¤ã§åˆ¤æ–ã•ã‚Œã‚‹ã®ã¯æœ›ã¾ã—ã„挙動ãªã®ã§ã—ょã†ã‹ã€‚
1.eql?(1.0) ã§ãªã„ã“ã¨ã‚’考慮ã™ã‚‹ã¨ã€
Vector[1].eql?(Vector[1.0]) #=> false
ãŒæœ›ã¾ã—ã„ã®ã§ã¯ãªã„ã§ã—ょã†ã‹?
Matrixã‚‚åŒã˜ãã§ã™ã€‚
Reported by http://pc11.2ch.net/test/read.cgi/tech/1215531152/487-493
e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B
In message “Re: [ruby-dev:36298] hash-equality of Vectors and Matrices”
on Mon, 15 Sep 2008 10:50:08 +0900, “Yugui (Yuki S.)”
[email protected] writes:
|e$B8=>u$^$Ge(BMatrix#eql? e$B$He(B Vector#eql? e$B$O$=$l$>$le(B == e$B$N%(%$%j%“%9$G$7$?e(B(e$B$3$Ne(B
|e$B%(%$%j%”%9:n@.$Ne(Btypoe$B$,e(B[ruby-dev:36294]e$B$G$7$?e(B)e$B!#e(B
|
|e$B$H$3$m$G!"e(Beql?e$B$,F1CM$GH=CG$5$l$k$N$OK>$^$7$$5sF0$J$N$G$7$g$&$+!#e(B
|1.eql?(1.0) e$B$G$J$$$3$H$r9MN8$9$k$H!"e(B
| Vector[1].eql?(Vector[1.0]) #=> false
|e$B$,K>$^$7$$$N$G$O$J$$$G$7$g$&$+e(B?
|
|Matrixe$B$bF1$8$/$G$9!#e(B
e$B$=$NDL$j$G$9$M!#%3%_%C%H$7$F$/$@$5$$!#e(B