ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-dev:50715] [Ruby trunk Bug#15432] Float の NaN のみを含む配列比較のテスト
       [not found] <redmine.issue-15432.20181218084648@ruby-lang.org>
@ 2018-12-18  8:46 ` shuujii
  2019-06-13  1:45 ` [ruby-dev:50799] " merch-redmine
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: shuujii @ 2018-12-18  8:46 UTC (permalink / raw)
  To: ruby-dev

Issue #15432 has been reported by shuujii (Shuji KOBAYASHI).

----------------------------------------
Bug #15432: Float の NaN のみを含む配列比較のテスト
https://bugs.ruby-lang.org/issues/15432

* Author: shuujii (Shuji KOBAYASHI)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.6.0rc2 (2018-12-15 trunk 66408) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Float の NaN のみを含む配列比較のテストが以下にあります。

~~~ ruby
## spec/ruby/core/array/equal_value_spec.rb:47

# As per bug #1720
it "returns false for [NaN] == [NaN]" do
  [nan_value].should_not == [nan_value]
end
~~~

しかし、これは #1720 で未定義動作とするとなったと思うので不要ではないでしょうか。

現状では以下のようになるので意味のないテストだと思います。

~~~ ruby
[Float::NAN] == [Float::NAN]  #=> true
[Float::NAN] == [0/0.0]       #=> false
~~~ 



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-dev:50799] [Ruby trunk Bug#15432] Float の NaN のみを含む配列比較のテスト
       [not found] <redmine.issue-15432.20181218084648@ruby-lang.org>
  2018-12-18  8:46 ` [ruby-dev:50715] [Ruby trunk Bug#15432] Float の NaN のみを含む配列比較のテスト shuujii
@ 2019-06-13  1:45 ` merch-redmine
  2019-06-27 17:44 ` [ruby-dev:50807] " eregontp
  2019-06-27 17:58 ` [ruby-dev:50808] " eregontp
  3 siblings, 0 replies; 4+ messages in thread
From: merch-redmine @ 2019-06-13  1:45 UTC (permalink / raw)
  To: ruby-dev

Issue #15432 has been updated by jeremyevans0 (Jeremy Evans).


I agree that keeping this spec does not make sense.  If nobody objects within the next week, I will delete the spec.

----------------------------------------
Bug #15432: Float の NaN のみを含む配列比較のテスト
https://bugs.ruby-lang.org/issues/15432#change-78501

* Author: shuujii (Shuji KOBAYASHI)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.6.0rc2 (2018-12-15 trunk 66408) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Float の NaN のみを含む配列比較のテストが以下にあります。

~~~ ruby
## spec/ruby/core/array/equal_value_spec.rb:47

# As per bug #1720
it "returns false for [NaN] == [NaN]" do
  [nan_value].should_not == [nan_value]
end
~~~

しかし、これは #1720 で未定義動作とするとなったと思うので不要ではないでしょうか。

現状では以下のようになるので意味のないテストだと思います。

~~~ ruby
[Float::NAN] == [Float::NAN]  #=> true
[Float::NAN] == [0/0.0]       #=> false
~~~ 



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-dev:50807] [Ruby trunk Bug#15432] Float の NaN のみを含む配列比較のテスト
       [not found] <redmine.issue-15432.20181218084648@ruby-lang.org>
  2018-12-18  8:46 ` [ruby-dev:50715] [Ruby trunk Bug#15432] Float の NaN のみを含む配列比較のテスト shuujii
  2019-06-13  1:45 ` [ruby-dev:50799] " merch-redmine
@ 2019-06-27 17:44 ` eregontp
  2019-06-27 17:58 ` [ruby-dev:50808] " eregontp
  3 siblings, 0 replies; 4+ messages in thread
From: eregontp @ 2019-06-27 17:44 UTC (permalink / raw)
  To: ruby-dev

Issue #15432 has been updated by Eregon (Benoit Daloze).


It makes sense in the context of #1720.

I.e., all Ruby implementations behave that way, because `Float::NAN.equal? Float::NAN` must be true, and Array#== uses an #equal? + a #== check, not just #==. I want to restore the spec and add that explanation.

IMHO there is no "undefined behavior" in Ruby, there is MRI behavior and that's what other Ruby implementations have to comply to, unless proven a bug or desirable to differ.

----------------------------------------
Bug #15432: Float の NaN のみを含む配列比較のテスト
https://bugs.ruby-lang.org/issues/15432#change-78914

* Author: shuujii (Shuji KOBAYASHI)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.6.0rc2 (2018-12-15 trunk 66408) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Float の NaN のみを含む配列比較のテストが以下にあります。

~~~ ruby
## spec/ruby/core/array/equal_value_spec.rb:47

# As per bug #1720
it "returns false for [NaN] == [NaN]" do
  [nan_value].should_not == [nan_value]
end
~~~

しかし、これは #1720 で未定義動作とするとなったと思うので不要ではないでしょうか。

現状では以下のようになるので意味のないテストだと思います。

~~~ ruby
[Float::NAN] == [Float::NAN]  #=> true
[Float::NAN] == [0/0.0]       #=> false
~~~ 



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-dev:50808] [Ruby trunk Bug#15432] Float の NaN のみを含む配列比較のテスト
       [not found] <redmine.issue-15432.20181218084648@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2019-06-27 17:44 ` [ruby-dev:50807] " eregontp
@ 2019-06-27 17:58 ` eregontp
  3 siblings, 0 replies; 4+ messages in thread
From: eregontp @ 2019-06-27 17:58 UTC (permalink / raw)
  To: ruby-dev

Issue #15432 has been updated by Eregon (Benoit Daloze).


Actually, the `should_not` above indeed doesn't make much sense, because it relies on `nan_value` returning different NaNs, which is probably platform-specific.

I added a spec for this case: `[Float::NAN].should == [Float::NAN]`.

----------------------------------------
Bug #15432: Float の NaN のみを含む配列比較のテスト
https://bugs.ruby-lang.org/issues/15432#change-78915

* Author: shuujii (Shuji KOBAYASHI)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.6.0rc2 (2018-12-15 trunk 66408) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Float の NaN のみを含む配列比較のテストが以下にあります。

~~~ ruby
## spec/ruby/core/array/equal_value_spec.rb:47

# As per bug #1720
it "returns false for [NaN] == [NaN]" do
  [nan_value].should_not == [nan_value]
end
~~~

しかし、これは #1720 で未定義動作とするとなったと思うので不要ではないでしょうか。

現状では以下のようになるので意味のないテストだと思います。

~~~ ruby
[Float::NAN] == [Float::NAN]  #=> true
[Float::NAN] == [0/0.0]       #=> false
~~~ 



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-27 17:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-15432.20181218084648@ruby-lang.org>
2018-12-18  8:46 ` [ruby-dev:50715] [Ruby trunk Bug#15432] Float の NaN のみを含む配列比較のテスト shuujii
2019-06-13  1:45 ` [ruby-dev:50799] " merch-redmine
2019-06-27 17:44 ` [ruby-dev:50807] " eregontp
2019-06-27 17:58 ` [ruby-dev:50808] " eregontp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).