floatlog()
Description
Return the logarithm of a value
Syntax
floatlog(value, num);
Parameters
Variable | Input |
|---|---|
| The value to calculate the logarithm of. |
| The logarithmic base to use; the default base is 10. |
Returns
The result: the logarithm of the input number.
Function call example
Float type numbers logarithm example
new data1=8;
new data2=15;
new Float: data3;
new Float: data4;
new Float: log;
main(){
data3 = float(data1); //first convert previous data into floating point if it wasn't before
data4 = float(data2); //first convert previous data into floating point if it wasn't before
log = floatlog(data4, data3); //result of log will be log = 1.30230
while(1){
Delay(100);
}
}Notes and Warnings
This function raises a “domain” error is the input value is zero or negative.