Issue 7158 in pharo: Let 0.0 negated answer Float negativeZero

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 7158 in pharo: Let 0.0 negated answer Float negativeZero

pharo
Status: Accepted
Owner: ----
Labels: Milestone-2.0 Type-Feature

New issue 7158 by [hidden email]: Let 0.0 negated answer Float  
negativeZero
http://code.google.com/p/pharo/issues/detail?id=7158

I have this working correctly:
     (SqNumberParser readSmalltalkNumberFrom: '-0.0') -> -0.0.
But note the difference with:
     (Compiler evaluate: '-0.0') -> 0.0.

This is beacuse parser send negated by itself.

I suggest 0.0 negated -> -0.0.
This is easy to implement:

Float>>negated
     ^Float negativeZero - self

Then once we have boostrapped with above code, we can further simplify with  
a literal:

Float>>negated
     ^-0.0 - self



_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 7158 in pharo: Let 0.0 negated answer Float negativeZero

pharo

Comment #1 on issue 7158 by [hidden email]: Let 0.0 negated answer  
Float negativeZero
http://code.google.com/p/pharo/issues/detail?id=7158

Or it could also be ^-1.0*self with no need to bootstrap.


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 7158 in pharo: Let 0.0 negated answer Float negativeZero

pharo
Updates:
        Status: FixReviewNeeded

Comment #2 on issue 7158 by [hidden email]: Let 0.0 negated answer  
Float negativeZero
http://code.google.com/p/pharo/issues/detail?id=7158

Test+Fix in Squeak+Pharo inbox
Name:  
SLICE-Issue-7158-Let-Compiler-evaluate-Float-negativeZero-nicolascellier.1


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 7158 in pharo: Let 0.0 negated answer Float negativeZero

pharo

Comment #3 on issue 7158 by [hidden email]: Let 0.0 negated answer  
Float negativeZero
http://code.google.com/p/pharo/issues/detail?id=7158

Thanks!


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 7158 in pharo: Let 0.0 negated answer Float negativeZero

pharo

Comment #4 on issue 7158 by [hidden email]: Let 0.0 negated answer  
Float negativeZero
http://code.google.com/p/pharo/issues/detail?id=7158

I loaded the slice in 20448 and worked fine:

(Compiler evaluate: '-0.0') ---> -0.0.

0.0 negated ---> -0.0.

(CompilerTest selector: #testNegativeZero) run ---> 1 run, 1 passes, 0  
skipped, 0 expected failures, 0 failures, 0 errors, 0 unexpected passes


Is a valid review?


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 7158 in pharo: Let 0.0 negated answer Float negativeZero

pharo

Comment #5 on issue 7158 by [hidden email]: Let 0.0 negated answer  
Float negativeZero
http://code.google.com/p/pharo/issues/detail?id=7158

Thanks martin!


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 7158 in pharo: Let 0.0 negated answer Float negativeZero

pharo
Updates:
        Status: FixToInclude

Comment #6 on issue 7158 by [hidden email]: Let 0.0 negated answer  
Float negativeZero
http://code.google.com/p/pharo/issues/detail?id=7158

(No comment was entered for this change.)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 7158 in pharo: Let 0.0 negated answer Float negativeZero

pharo
Updates:
        Status: Integrated

Comment #7 on issue 7158 by [hidden email]: Let 0.0 negated answer  
Float negativeZero
http://code.google.com/p/pharo/issues/detail?id=7158

in 2.0 449


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker