Issue 5911 in pharo: Float floorLog: 2 could be exact

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

Issue 5911 in pharo: Float floorLog: 2 could be exact

pharo
Status: FixReviewNeeded
Owner: [hidden email]
Labels: Type-Enh

New issue 5911 by [hidden email]: Float floorLog: 2 could be exact
http://code.google.com/p/pharo/issues/detail?id=5911

If relying on log:, Float floorLog: 2 will be inexact for some numbers  
(answer off by one values).

That's a pity: since Float are represented in base 2 internally, an exact  
version of floorLog: 2 is trivial.

Find a test that demonstrates it and a fix too (I just published'em in  
squeak trunk).

I wanted to verify that
    x ulp = (1.0 timesTwoPower: (x floorLog: 2) + 1 - Float precision).
for every finite strictly positive and normalized Float x (where normalized  
= not degenerated by gradual underflow).
But just could not...

Attachments:
        FloatTest-testFloorLog2.st  698 bytes
        Fix_Float_floorLog2.st  398 bytes


_______________________________________________
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 5911 in pharo: Float floorLog: 2 could be exact

pharo
Updates:
        Labels: Milestone-2.0

Comment #1 on issue 5911 by [hidden email]: Float floorLog: 2 could  
be exact
http://code.google.com/p/pharo/issues/detail?id=5911

(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 5911 in pharo: Float floorLog: 2 could be exact

pharo
Updates:
        Status: FixToInclude

Comment #2 on issue 5911 by [hidden email]: Float floorLog: 2 could  
be exact
http://code.google.com/p/pharo/issues/detail?id=5911

(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 5911 in pharo: Float floorLog: 2 could be exact

pharo
Updates:
        Status: Integrated

Comment #3 on issue 5911 by [hidden email]: Float floorLog: 2 could  
be exact
http://code.google.com/p/pharo/issues/detail?id=5911

in 2.0 086


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