LN¶
Returns the natural logarithm of a numeric input.
Signature¶
┌─────────┐
IN ─┤ LN ├─ OUT
└─────────┘
FUNCTION LN : ANY_REAL
VAR_INPUT
IN : ANY_REAL;
END_VAR
END_FUNCTION
The return type matches the input type. LN accepts REAL,
LREAL.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
The positive value to compute the natural logarithm of. |
Outputs
Name |
Type |
Description |
|---|---|---|
Return value |
|
The natural logarithm (base e) of IN. Same type as IN. |
Description¶
Returns the natural logarithm (base e) of IN. The input must be
positive; the result of LN applied to zero or a negative value
is undefined.
Example¶
result := LN(REAL#2.718282); (* result ~ 1.0 *)
value := LN(LREAL#1.0); (* value = 0.0 *)
See Also¶
References¶
IEC 61131-3 §2.5.1.5.2