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

=== on Num and Complex doesn't distinguish signed zeroes #5595

Closed
p6rt opened this issue Aug 19, 2016 · 4 comments
Closed

=== on Num and Complex doesn't distinguish signed zeroes #5595

p6rt opened this issue Aug 19, 2016 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 19, 2016

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

Searchable as RT128999$

@p6rt
Copy link
Author

p6rt commented Aug 19, 2016

From zefram@fysh.org

(0e0).WHICH
Num|0
(-0e0).WHICH
Num|-0
0e0 === -0e0
True

These two Num values are distinct​: they are the floating-point signed
zeroes, which have different numeric behaviour in some situations.
The .WHICH values correctly distinguish them. The === operator is
incorrect in saying that they are the same object. The same problem
arises with Complex numbers with zero real or imaginary parts​:

<-0+0i>.WHICH
Complex|-0|0
<0+0i>.WHICH
Complex|0|0
<0-0i>.WHICH
Complex|0|-0
<-0-0i>.WHICH
Complex|-0|-0
<-0+0i> === <0+0i> === <0-0i> === <-0-0i>
True

-zefram

@p6rt
Copy link
Author

p6rt commented Dec 12, 2016

From @zoffixznet

On Fri, 19 Aug 2016 14​:04​:10 -0700, zefram@​fysh.org wrote​:

(0e0).WHICH
Num|0
(-0e0).WHICH
Num|-0
0e0 === -0e0
True

These two Num values are distinct​: they are the floating-point signed
zeroes, which have different numeric behaviour in some situations.
The .WHICH values correctly distinguish them. The === operator is
incorrect in saying that they are the same object. The same problem
arises with Complex numbers with zero real or imaginary parts​:

<-0+0i>.WHICH
Complex|-0|0
<0+0i>.WHICH
Complex|0|0
<0-0i>.WHICH
Complex|0|-0
<-0-0i>.WHICH
Complex|-0|-0
<-0+0i> === <0+0i> === <0-0i> === <-0-0i>
True

-zefram

Thank you for the report. The Num case was fixed awhile back as part of RT#​128395. The Complex is now fixed as well.

Fix​: rakudo/rakudo@55cf6fa9e1
Tests​: Raku/roast@15c0978fed

@p6rt
Copy link
Author

p6rt commented Dec 12, 2016

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

@p6rt
Copy link
Author

p6rt commented Dec 12, 2016

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

@p6rt p6rt closed this as completed Dec 12, 2016
@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