truncate/floor with logBase

Alastair Reid alastair@reid-consulting-uk.ltd.uk
29 Sep 2002 22:58:57 +0100


Thorsten Stocksmeier <thorsten.stocksmeier@t-online.de> writes:

Main> floor (logBase 2 (fromInteger 32768)) -- should be == floor 15.0
> 14

Rounding error I suspect.

Prelude> logBase 2 (fromInteger 32768) - 15.0
-9.53674e-07

--
Alastair Reid                 alastair@reid-consulting-uk.ltd.uk  
Reid Consulting (UK) Limited  http://www.reid-consulting-uk.ltd.uk/alastair/