Learn R Programming

matlab2r (version 1.5.0)

log2: Base 2 logarithm

Description

Base 2 logarithm and floating-point number dissection

Usage

log2(X, dissect = TRUE)

Value

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

Arguments

X

a scalar or vector of numbers

dissect

if TRUE, returns the mantissa and exponent.

Examples

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

Run the code above in your browser using DataLab