log2: Base 2 logarithm

View source: R/log2.R

log2R 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

matlab2r documentation built on Feb. 16, 2023, 10:39 p.m.

Related to log2 in matlab2r...