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

Language Guide / Functions ยท Generated namespace reference

floor

klang::floor

Rounds down to an integer value.

Returns the largest integer value less than or equal to the input. For example, it can find the lower sample index for a fractional position. Scaling the input before rounding and scaling it back afterwards can quantise audio for a bitcrushing effect.

-2.5-3-1.25-1.750-0.51.250.752.52ResultInput x
floor(x)

Based on std::floor.

Direct call

const signal index = floor(position);

Signal flow

const signal index = position >> floor;