Click or drag to resize

Log10 Function

X#
Calculate the common logarithm of a numeric value.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION Log10(
	nValue AS USUAL
) AS FLOAT
Request Example View Source

Parameters

nValue
Type: Usual
A number greater than 0 to convert to its common logarithm.

Return Value

Type: Float
The common logarithm of nValue.
If nValue is less than or equal to 0, Log10() generates a run-time error.
Remarks
Log10() is the inverse of the power (to the base 10) operator (** or ^).
The common logarithm has a base of 10.
The Log10() function returns x in the following equation:
X#
110^x = y
where y is the numeric expression used as the Log10() argument (that is, Log10(y) = x).
Due to mathematical rounding, the values returned by Log10() and the power operator (** or ^) may not agree exactly (that is, 10^(Log10(n)) may not always equal n).
Examples
These examples demonstrate various results of Log10():
X#
1? Log10(10)                        // 1.00
2? Log10(10 ^ 2)                    // 2.00
3? 10 ^(Log10(1))                    // 1.00
4? 10 ^(Log10(10))                    // 10.00
5? Log10(1000)                        // 3.00
6? Log10(1100.9)                    // 3.04
See Also