Table of Contents
Returns the natural logarithm (base e) of a number.
1. Description
The ln operator pops a positive number from the operand stack and pushes its natural logarithm (logarithm base e, where e ≈ 2.71828). The operand must be positive; zero or negative values cause a rangecheck error. The result is always a real number.
This is a Level 1 operator, available in all PostScript implementations.
8. Error Conditions
stackunderflow-
The operand stack is empty.
typecheck-
The operand is not a number.
rangecheck-
The operand is zero or negative.
0 ln % ERROR: rangecheck -5 ln % ERROR: rangecheck
9. See Also
-
Arithmetic and Math - All arithmetic operators