t2:log2

log2


log2 — Binary logarithm (base-2)

Description


fix32 log2(fix32 num);

Computes the base 2 logarithm of num.

Parameters


  • num: Value whose logarithm is calculated.

Return Value


The binary logarithm of num.

Examples


Example #1 log2() example

init {
    printf("%.6f", log2(1024.0)); // 10.000000
    printf("%.6f", log2(0.125));  // -3.000000
}

See Also


t2/log2.txt · Last modified: 2016/11/13 06:36 by J2Kbr