Difference between revisions of "SHIP:Sail:log"

From Serious Documentation
Jump to: navigation, search
(Created page with "__NOTOC__ {{SailFuncTableStart|}}<onlyinclude> |{{SailFunc|log}}||{{DataType|Float}}||style="text-align:center;"|v5.1.0||Return the base 10 log of a number{{v5}}</onlyinclude>...")
 
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
{{SailFuncTableStart|}}<onlyinclude>
 
{{SailFuncTableStart|}}<onlyinclude>
|{{SailFunc|log}}||{{DataType|Float}}||style="text-align:center;"|v5.1.0||Return the base 10 log of a number{{v5}}</onlyinclude>
+
|{{SailFunc|log}}||{{DataType|Float}}||style="text-align:center;"|v5.1.0||Return the natural log of a number{{v5}}</onlyinclude>
 
|}
 
|}
 
== See Also: ==
 
== See Also: ==
Line 7: Line 7:
 
*[[SHIP:Sail:Functions|Sail Functions]]
 
*[[SHIP:Sail:Functions|Sail Functions]]
 
*[[SHIP:Sail:Numeric Functions|Sail Numeric Functions]]
 
*[[SHIP:Sail:Numeric Functions|Sail Numeric Functions]]
*{{SailFunc|abs}}, {{SailFunc|exp}}, {{SailFunc|expm1}}, {{SailFunc|pow}}, {{SailFunc|max}}, {{SailFunc|min}}
+
*{{SailFunc|log10}}, {{SailFunc|exp}}, {{SailFunc|expm1}}, {{SailFunc|pow}}, {{SailFunc|max}}, {{SailFunc|min}}
 
== Prototype ==
 
== Prototype ==
 
<code>{{DataType|Float}} {{SailFunc|log}}({{DataType|Float}} n);</code>
 
<code>{{DataType|Float}} {{SailFunc|log}}({{DataType|Float}} n);</code>
Line 17: Line 17:
 
! scope="col" style="text-align:left" | Description
 
! scope="col" style="text-align:left" | Description
 
|-
 
|-
|n||{{DataType|Float}}||the number to take the log of
+
|n||{{DataType|Float}}||the number to take the natural log of
 
|-
 
|-
 
! scope="col" style="text-align:left" | Return
 
! scope="col" style="text-align:left" | Return
 
! scope="col" style="text-align:left" | {{DataType|Float}}
 
! scope="col" style="text-align:left" | {{DataType|Float}}
! scope="col" style="text-align:left" | the result of log n
+
! scope="col" style="text-align:left" | the result of log n (ln n)
 
|}
 
|}
  
 
== Detailed Description ==
 
== Detailed Description ==
  
The <code>{{SailFunc|log}}()</code> function returns the base 10 log of a number.
+
The <code>{{SailFunc|log}}()</code> function returns the base e log of a number.
  
 
== Examples ==
 
== Examples ==
Line 36: Line 36:
 
|<code>{{SailFunc|log}}(1);</code> || 0.000000... ||
 
|<code>{{SailFunc|log}}(1);</code> || 0.000000... ||
 
|-
 
|-
|<code>{{SailFunc|log}}(5);</code> || 0.6989700... ||
+
|<code>{{SailFunc|log}}(5);</code> || 1.609437... ||
 
|-
 
|-
|<code>{{SailFunc|log}}(1000);</code> || 3.000000... ||
+
|<code>{{SailFunc|log}}(1000);</code> || 6.907755... ||
 
|}
 
|}

Revision as of 10:09, 30 September 2016

Function Returns Introduced Description
log Float v5.1.0 Return the natural log of a numberBadge SHIPv5.gif

See Also:

Prototype

Float log(Float n);

Parameters/Return Value

Parameter Data Type Description
n Float the number to take the natural log of
Return Float the result of log n (ln n)

Detailed Description

The log() function returns the base e log of a number.

Examples

Example Result Notes
log(1); 0.000000...
log(5); 1.609437...
log(1000); 6.907755...