74 lines
1.6 KiB
HTML
74 lines
1.6 KiB
HTML
<html>
|
|
<head>
|
|
<title>Blitz3D Docs</title>
|
|
<link rel=stylesheet href=../css/commands.css type=text/css>
|
|
</head>
|
|
<body>
|
|
<h1>Log# ( x# )</h1>
|
|
<h1>Parameters</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
x = any positive number.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1>Description</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
Natural logarithm of x. This is the inverse of Exp( ).
|
|
|
|
<br />
|
|
|
|
<br />
|
|
y = Log( x ) means y satifies x = Exp( y ).
|
|
|
|
<br />
|
|
|
|
<br />
|
|
The base of the natural logarithm is e = Exp(1) = 2.71828...
|
|
|
|
<br />
|
|
|
|
<br />
|
|
See also Exp()
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1><a href=../2d_examples/Log.bb>Example</a></h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
; Log example
|
|
<br />
|
|
|
|
<br />
|
|
; NaN means "Not a Number", the numerical result is invalid.
|
|
<br />
|
|
|
|
<br />
|
|
; NOTE: All logarithm functions are related. For example, there is no
|
|
<br />
|
|
; Log8 function in Blitz, but we can easily make one.
|
|
<br />
|
|
|
|
<br />
|
|
HidePointer
|
|
<br />
|
|
|
|
<br />
|
|
Print "Log8( -1 ) = " + Log8( -1 )
|
|
<br />
|
|
Print "Log8( 0 ) = " + Log8( 0 )
|
|
<br />
|
|
Print
|
|
<br />
|
|
|
|
<br />
|
|
; ... and now some well behaved numbers...
|
|
<br />
|
|
|
|
<br />
|
|
x# = 1.0 / 4096.0 ; small positive number
|
|
<br />
|
|
|
|
<br />
|
|
For n = 1 To 15
|
|
<br />
|
|
|
|
<br />
|
|
Print "Log8( " + LSet( x, 13 ) + " ) = " + Log8( x )
|
|
<br />
|
|
x = 8 * x
|
|
<br />
|
|
|
|
<br />
|
|
Next
|
|
<br />
|
|
|
|
<br />
|
|
WaitKey() : End
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<br />
|
|
Function Log8# ( x# )
|
|
<br />
|
|
|
|
<br />
|
|
Return Log( x ) / Log( 8 )
|
|
<br />
|
|
|
|
<br />
|
|
End Function
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<a target=_top href=../index.htm>Index</a><br>
|
|
<br>
|
|
Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=Log&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
|
|
</html>
|