### 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.