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

Language Guide / Functions ยท Generated namespace reference

round

klang::round

Rounds to the nearest integer, with ties away from zero.

Rounds to the nearest integer, with halfway values moving away from zero. Scaling the input and result can quantise a signal to fractional steps.

-2.25-2-1.12-1001.1212.252ResultInput x
round(x)

Based on std::round.

Direct call

const signal stepped = round(sample * 8) / 8;

Signal flow

const signal stepped = (sample * 8 >> round) / 8;