comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: "ALOG2" ? (Ugly code follows)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: "ALOG2" ? (Ugly code follows) [message #14862] Sat, 03 April 1999 00:00 Go to previous message
luthi is currently offline  luthi
Messages: 20
Registered: March 1999
Junior Member
Amara

wouldn't it be simpler to use the transformations for the base of a logaritm
described in any mathematics text?

log2(x) = ln(x)*log2(e)

(or in idl-language: alog2(x) = alog(x)*alog2(exp(1.0)) )

then you still have to calculate log2(e) but this is 1/ln(2), so the
simplyfied code looks like

function alog2, x
return, alog(x)/alog(2.0)
end ;{alog2}

(of course this works for any base)

hope this helps!

Martin

--
============================================================
Martin Luethi Tel. +41 1 632 40 92
Glaciology Section Fax. +41 1 632 11 92
VAW ETH Zuerich
CH-8092 Zuerich mail luthi@vaw.baum.ethz.ch
Switzerland
============================================================
[Message index]
 
Read Message
Read Message
Previous Topic: "ALOG2" (lame question)
Next Topic: "ALOG2" ? (Ugly code follows)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 09:29:15 PDT 2025

Total time taken to generate the page: 0.48472 seconds