Difference between revisions of "LogTen"

Line 6: Line 6:
 
The base-10 logarithm of «x».  This the the value ''y'' such that ''10^y = x''.
 
The base-10 logarithm of «x».  This the the value ''y'' such that ''10^y = x''.
  
«x» must be non-negative or a warning will result.  If [[Preferences|Show Result Warnings]] is off, or the warning is ignored, the result is [[NaN]].
+
Unless [[EnableComplexNumbers|complex numbers are enabled]], the parameter «x» must be must be non-negative or a warning will result.  If [[Preferences|Show Result Warnings]] is off, or the warning is ignored, the result is [[NaN]].
 +
 
 +
When [[EnableComplexNumbers|complex numbers are enabled]], negative «x» values result in a result that is a complex number.
  
 
= Library =
 
= Library =
Line 19: Line 21:
 
:LogTen(1K) → 3
 
:LogTen(1K) → 3
 
:LogTen(729) / LogTen(9) → 3
 
:LogTen(729) / LogTen(9) → 3
 +
 +
= Complex numbers =
 +
 +
When «x» is negative or complex, the result of <code>[[LogTen]](x)</code> is a complex number.  If you want [[LogTen]] to return a complex number for a negative parameter, you must set the system variable [[EnableComplexNumbers]] to 1, otherwise a warning is issued with a result of [[NaN]].  To set [[EnableComplexNumbers]], see [[EnableComplexNumbers|enabling complex numbers]].
 +
 +
A complex number can be written in polar form as <math>r e^{\theta j}</math>. Thus, <math>\log x = \log r + {\theta\over{\log(10)}} j</math>.  In other words, the real part of the result is the log magnitude, and the imaginary part is proportional to phasor angle, where <math>\theta</math> is written here as if in radians.
 +
 +
:<code>LogTen(-1)</code>&rarr;1.364j      ''&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Note: when [[EnableComplexNumbers]] is 1''
 +
:<code>LogTen(1000j)</code>&rarr;3+0.682j
  
 
= See Also =
 
= See Also =
  
 
* [[Ln]](X) : The natural logarithm.
 
* [[Ln]](X) : The natural logarithm.
 +
* [[Exp]](x)
 +
* [[Complex Numbers]]
 +
 +
<comments />

Revision as of 19:39, 15 April 2013


LogTen(x)

The base-10 logarithm of «x». This the the value y such that 10^y = x.

Unless complex numbers are enabled, the parameter «x» must be must be non-negative or a warning will result. If Show Result Warnings is off, or the warning is ignored, the result is NaN.

When complex numbers are enabled, negative «x» values result in a result that is a complex number.

Library

Math functions

Examples

LogTen(0) → -INF
LogTen(0.01) → -2
LogTen(1) → 0
LogTen(1K) → 3
LogTen(729) / LogTen(9) → 3

Complex numbers

When «x» is negative or complex, the result of LogTen(x) is a complex number. If you want LogTen to return a complex number for a negative parameter, you must set the system variable EnableComplexNumbers to 1, otherwise a warning is issued with a result of NaN. To set EnableComplexNumbers, see enabling complex numbers.

A complex number can be written in polar form as [math]\displaystyle{ r e^{\theta j} }[/math]. Thus, [math]\displaystyle{ \log x = \log r + {\theta\over{\log(10)}} j }[/math]. In other words, the real part of the result is the log magnitude, and the imaginary part is proportional to phasor angle, where [math]\displaystyle{ \theta }[/math] is written here as if in radians.

LogTen(-1)→1.364j          Note: when EnableComplexNumbers is 1
LogTen(1000j)→3+0.682j

See Also


You are not allowed to post comments.

Comments
<comments />