log2 {matlab2r}R Documentation

Base 2 logarithm

Description

Base 2 logarithm and floating-point number dissection

Usage

log2(X, dissect = TRUE)

Arguments

X

a scalar or vector of numbers

dissect

if TRUE, returns the mantissa and exponent.

Value

either a vector or a list of mantissas and exponents such that mantissa * 2 ^ exponent equals X

Examples

log2(10, dissect = FALSE)
log2(10)
.625 * 2 ^ 4 == 10  # proof

[Package matlab2r version 1.5.0 Index]