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

Language Guide / Functions ยท Generated namespace reference

trunc

klang::trunc

Rounds towards zero.

Rounds towards zero and can be used to keep only the signed integer part of a control value. truncate is an alias that supports the same direct-call and signal-flow forms.

-2.5-2-1.25-1001.2512.52ResultInput x
trunc(x)

Based on std::trunc.

Direct call

const signal steps = trunc(sample * 8);

Signal flow

const signal steps = sample * 8 >> trunc;

Use the alias

const signal steps = sample * 8 >> truncate;