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

Language Guide / Functions ยท Generated namespace reference

ceil

klang::ceil

Rounds up to an integer value.

Returns the smallest integer value greater than or equal to the input. For example, it can find the upper 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-2-1.25-0.7500.51.251.752.53ResultInput x
ceil(x)

Based on std::ceil.

Direct call

const signal index = ceil(position);

Signal flow

const signal index = position >> ceil;