# Hash-equality of Vectors and Matrices

**URL:** <https://www.ruby-forum.com/t/hash-equality-of-vectors-and-matrices/148565>\
**Category:** Development\
**Created:** [September 15, 2008, 3:57am UTC](https://www.ruby-forum.com/t/hash-equality-of-vectors-and-matrices/148565 "2008-09-15T03:57:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yugui\_SYuki\_S.S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/dec6dc/32.png) [@Yugui\_SYuki\_S.S](https://www.ruby-forum.com/u/Yugui_SYuki_S.S)\
**Post date:** [September 15, 2008, 3:57am UTC](https://www.ruby-forum.com/t/hash-equality-of-vectors-and-matrices/148565/1 "2008-09-15T03:57:48Z")

</div>

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](http://pc11.2ch.net/test/read.cgi/tech/1215531152/487-493)

---

<div class="post-metadata">

**Author:** ![Yugui\_SYuki\_S.S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/dec6dc/32.png) [@Yugui\_SYuki\_S.S](https://www.ruby-forum.com/u/Yugui_SYuki_S.S)\
**Post date:** [September 15, 2008, 5:19am UTC](https://www.ruby-forum.com/t/hash-equality-of-vectors-and-matrices/148565/2 "2008-09-15T05:19:04Z")

</div>

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.)”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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
