Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.ruby > #7039
| Newsgroups | comp.lang.ruby |
|---|---|
| Date | 2014-10-15 16:54 -0700 |
| Message-ID | <27215c23-bae9-47d1-bc00-db93fc96e6f2@googlegroups.com> (permalink) |
| Subject | Set.new([1,2,3]) == Set.new([1,2.0,3]) returns false |
| From | Aarti Parikh <aarti@kitereaders.com> |
I get that Set is built with a Hash and that's why this happens, but should it work like this? Do other languages handle it differently? irb(main):019:0> Set.new([1,2,3]) == Set.new([1,2.0,3]) => false irb(main):020:0> Set.new([1,2,3]) == Set.new([1,2,3]) => true irb(main):021:0> 2 == 2.0 => true irb(main):022:0> [2] == [2.0] => true -ap
Back to comp.lang.ruby | Previous | Next — Next in thread | Find similar
Set.new([1,2,3]) == Set.new([1,2.0,3]) returns false Aarti Parikh <aarti@kitereaders.com> - 2014-10-15 16:54 -0700 Re: Set.new([1,2,3]) == Set.new([1,2.0,3]) returns false Robert Klemme <shortcutter@googlemail.com> - 2014-10-16 08:34 +0200
csiph-web