ln

OPL function for the natural log

Purpose

OPL function to return the natural logarithm.

type
float

Syntax

ln(float f)

Description

Returns the natural logarithm of a floating-point value. You can use this function within IBM ILOG Script statements by specifying the OPL namespace:


( Opl.xxx() )

Example

float a=1;
float b=exp(1);
float c=100;

float lnofa=ln(a);
float lnofb=ln(b);
float lnofc=ln(c);

execute
{
   writeln("ln(",a,") gives ",lnofa);
   writeln("ln(",b,") gives ",lnofb); 
   writeln("ln(",c,") gives ",lnofc); 
}

Result

ln(1) gives 0
ln(2.718281828459045) gives 1
ln(100) gives 4.605170185988092