Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rakudo says NaN === NaN is False #2357

Closed
p6rt opened this issue Feb 8, 2011 · 7 comments
Closed

Rakudo says NaN === NaN is False #2357

p6rt opened this issue Feb 8, 2011 · 7 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Feb 8, 2011

Migrated from rt.perl.org#83622 (status was 'resolved')

Searchable as RT83622$

@p6rt
Copy link
Author

p6rt commented Feb 8, 2011

From @masak

<TimToady> rakudo​: say NaN == NaN
<p6eval> rakudo a37640​: OUTPUT«Bool​::False␤»
<masak> ?(NaN == NaN) is supposed to be False.
<masak> er, False.
<TimToady> rakudo​: say NaN === NaN
<p6eval> rakudo a37640​: OUTPUT«Bool​::False␤»
<TimToady> that one could be true, since it's asking a non-numeric question
<masak> hm, true.
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Oct 1, 2011

From @bbkr

2011.09 build​: still broken

bbkr​:rakudo-2011.09 bbkr$ ./perl6 -e 'say NaN == NaN'
Bool​::False
(this one works as expected)

bbkr​:rakudo-2011.09 bbkr$ ./perl6 -e 'say NaN === NaN'
Bool​::False
(this one not)

@p6rt
Copy link
Author

p6rt commented Oct 1, 2011

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Oct 14, 2012

From @coke

On Mon Feb 07 17​:12​:00 2011, masak wrote​:

<TimToady> rakudo​: say NaN == NaN
<p6eval> rakudo a37640​: OUTPUT«Bool​::False␤»
<masak> ?(NaN == NaN) is supposed to be False.
<masak> er, False.
<TimToady> rakudo​: say NaN === NaN
<p6eval> rakudo a37640​: OUTPUT«Bool​::False␤»
<TimToady> that one could be true, since it's asking a non-numeric question
<masak> hm, true.
* masak submits rakudobug

Test added in S02-types/nan.t
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Aug 19, 2014

From @coke

On Sat Oct 13 20​:13​:45 2012, coke wrote​:

On Mon Feb 07 17​:12​:00 2011, masak wrote​:

<TimToady> rakudo​: say NaN == NaN
<p6eval> rakudo a37640​: OUTPUT«Bool​::False␤»
<masak> ?(NaN == NaN) is supposed to be False.
<masak> er, False.
<TimToady> rakudo​: say NaN === NaN
<p6eval> rakudo a37640​: OUTPUT«Bool​::False␤»
<TimToady> that one could be true, since it's asking a non-numeric
question
<masak> hm, true.
* masak submits rakudobug

Test added in S02-types/nan.t

Fixed in a82c407.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Aug 19, 2014

@coke - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Aug 19, 2014
@p6rt
Copy link
Author

p6rt commented Aug 19, 2014

From @masak

masak (>>>), coke (>)​:

<TimToady> rakudo​: say NaN === NaN
<p6eval> rakudo a37640​: OUTPUT«Bool​::False␤»
<TimToady> that one could be true, since it's asking a non-numeric
question

[...]

Fixed in a82c407.

I just want to add, for completion, that discussion on #perl6 mentioned that there are different not-a-number values. Presumably NaN is only one of these, and it's possible through some computation paths to get other not-a-number values that aren't triple-equal to NaN. *Or* Perl 6 complete hides this difference and calls *all* not-a-number values NaN, so that NaN is actually a kind of representative for all not-a-number values, and if you want to be more specific than that, you have to create your own values and give them the appropriate behavior.

Ticket is still resolved, but the above considerations may be of interest for someone who revisits this issue in the future.

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant