Log

Description

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

Category

International functions

Syntax


Log(number) 

See also

Exp, Log10

Parameters

Parameter
Description
number
Positive real number for which you want the natural logarithm

Example

<!--- This example shows how to use Log --->

<html>

<head>

<title>Log Example</title>

</head>

<body bgcolor = silver>

<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>You must enter a positive real number to

see the natural logarithm of that number<cfelse><BR>The natural logarithm

of #FORM.number#: #log(FORM.number)#</cfif>

<cfif FORM.number LTE 0><BR>You must enter a positive real number to

see the logarithm of that number to base 10<cfelse><BR>The logarithm of

#FORM.number# to base 10: #log10(FORM.number)#</cfif>

</cfoutput>

</cfif>



<cfform action = "log.cfm" method = "POST">

Enter a number to see its value raised to the E power,

the natural logarithm of that number, 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>

</body>

</html> 



Banner.Novgorod.Ru