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=5911If 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