Skip to main content
Previous sectionNext section

$ZLOG

Returns the base 10 logarithm value of the specified positive numeric expression.

Synopsis

$ZLOG(n)

Parameter

Argument Description
n Any positive, nonzero number, which can be specified as a value, a variable, or an expression.

Description

$ZLOG returns the base 10 logarithm value of n.

Specifying zero or a negative number results in an <ILLEGAL VALUE> error.

The corresponding natural log (base e) function is $ZLN.

Examples

The following example writes the base 10 logarithms of the integers 1 through 10:

   FOR x=1:1:10 {
     WRITE !,"The log of ",x," = ",$ZLOG(x) 
     }
   QUIT
Copy code to clipboard

returns:

The log of 1 = 0
The log of 2 = .301029995663981195
The log of 3 = .477121254719662437
The log of 4 = .60205999132796239
The log of 5 = .698970004336018805
The log of 6 = .778151250383643633
The log of 7 = .845098040014256831
The log of 8 = .903089986991943586
The log of 9 = .954242509439324875
The log of 10 = 1
Copy code to clipboard
   WRITE $ZLOG($ZPI)
Copy code to clipboard

returns .4971498726941338541.

   WRITE $ZLOG(.5)
Copy code to clipboard

returns -.301029995663981195.

   WRITE $ZLOG(0)
Copy code to clipboard

issues an <ILLEGAL VALUE> error.

See Also