Notice: With the launch of Adobe Cookbooks, this site will no longer be accepting new entries or posting new content. Thanks to everyone who submitted content!

How do I work with logarithms?

The log() function returns the natural logarithm of its single numeric parameter:

<cfset testVar = log(100)>
<cfoutput>#testVar#</cfoutput>
4.60517018599

The exp() function is the inverse of the log() function:

<cfset testVar = exp(4.60517018599 )>
<cfoutput>#testVar#</cfoutput>
100

The log10() function returns the logarithm of its single numeric parameter to base 10:

<cfset testVar = log10(100)>
<cfoutput>#testVar#</cfoutput>
2


This question was written by Jeremy Petersen.
It was last updated on January 23, 2006 at 11:15:11 AM EST.

CFML Referenced

Exp()
Log10()
<cfoutput>
Log()

Categories

Numbers

Comments

There are no comments for this entry.