log
OPL function for the base–10 logarithm
Purpose
OPL function to return the base–10 logarithm.
| type |
|---|
float |
Syntax
log(float f)
Description
This function returns the base–10 logarithm of a floating-point value. You can use it within IBM ILOG Script statements by specifying the OPL namespace:
( Opl.xxx() )
Example
float a=1;
float b=20;
float c=100;
float logofa=log(a);
float logofb=log(b);
float logofc=log(c);
execute
{
writeln("log(",a,") gives ",logofa);
writeln("log(",b,") gives ",logofb);
writeln("log(",c,") gives ",logofc);
}
Result
log(1) gives 0
log(20) gives 1.301029995663981
log(100) gives 2