LOG2 Function

Returns the logarithm to the base 2.

Category: Mathematical

Syntax

LOG2(argument)

Required Argument

argument

specifies a numeric constant, variable, or expression.

Range must be positive.

Example

The following SAS statements produce these results.
SAS Statement
Result
x=log2(2.0);
1
x=log2(0.5);
-1