[Haskell] for large x, log (x::Integer) :: Double

Dylan Thurston dpt at lotus.bostoncoop.net
Sun Jul 4 06:32:39 EDT 2004


On Wed, Jun 30, 2004 at 03:07:00PM -0700, Greg Buchholz wrote:
> -- Inspired from Mr. Howard Oakley.  Might not qualify as "good",
> -- but with this function I get log10(x)=849.114419903382
> ... 

For those who aren't aware: working with logs base 2 internally will
be very much faster than logs base 10, since the numbers are stored
internally in a base-2 representation.  (Note that 'show' converts to
base 10, which involves a large number of divisions in the easy
algorithm.)

Peace,
	Dylan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org//pipermail/haskell/attachments/20040704/4ac90aa8/attachment.bin


More information about the Haskell mailing list