Klang C++ 0.7.15
Language Reference (draft)
Loading...
Searching...
No Matches
log2

Language Guide / Functions ยท Generated namespace reference

log2

klang::log2

Logarithm with base two.

Returns the base-2 logarithm of a positive value. It can express a frequency ratio as an octave offset.

0.05-4.321.04-2.742.02-1.163.010.4242ResultInput x
log2(x)

Based on std::log2.

Direct call

const signal octaves = log2(hz / 440);

Signal flow

const signal octaves = hz / 440 >> log2;