Contents > CFML Reference > ColdFusion Functions > Log PreviousNext

Log

Calculates the natural logarithm of a number. Natural logarithms are based on the constant e (2.71828182845904).

The natural logarithm of a number.

Mathematical functions

Log(number)

Exp, Log10

Parameter

Description

number

Positive real number for which to calculate the natural logarithm

<h3>Log Example</h3>

<cfif IsDefined("FORM.number")>
   <cfoutput>
      <p>Your number, #FORM.number#
      <br>#FORM.number# raised to the E power: #exp(FORM.number)#
      <cfif FORM.number LTE 0><br>Enter a positive real number to get its 
natural logarithm <cfelse><br>The natural logarithm of #FORM.number#: #log(FORM.number)# </cfif> <cfif FORM.number LTE 0><br>Enter a positive real number to get its
logarithm to base 10 <cfelse><br>The logarithm of #FORM.number# to base 10: #log10(FORM.number)# </cfif> </cfoutput> </cfif> <cfform action = "log.cfm"> Enter a number to see its value raised to the E power, its natural logarithm,
and the logarithm of number to base 10. <cfinput type = "Text" name = "number" message = "You must enter a number"
validate = "float" required = "No"> <input type = "Submit" name = ""> </cfform>

Contents > CFML Reference > ColdFusion Functions > Log PreviousNext

ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functb25.htm