Returns the logarithm of the number represented in number to the base indicated by base.
An error occurs if either of number or base is not a valid number. The number must be equal to, or greater than 1.
log(number, [base])
Parameter | Type | Description |
---|---|---|
number | Decimal number | Any decimal number |
base | Decimal number | optional. A number representing the base for which the logarithm will be computed. If no base is supplied, a base of 10 is used. |
A string containing the log of the number to the base, or an empty string if an error occurs.
In this example, the result of log is "2".
<field sid="logTestField">
<label>Test log()</label>
<format>
<datatype>string</datatype>
<constraints>
<mandatory>on</mandatory>
</constraints>
</format>
<value compute="log('100', '10')"></value>
</field>