Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Reaktor/Tutorials/Rounding a number

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Suppose you have a floating point number, for example the output of a mouse area, and you want to round this number to the lower integer bound. One way to do this is to Modulo/Divide the number by 1. Input -> Modulo.A Modulo.Div -> RoundedNumber 1 -> Modulo.B It is often useful to add a StepFilter on the output if you only want to trigger on changing values. In Core, you can round a number by building a macro with a float input and an integer output. If you want to round to the upper number, you can add 1 first. If you want to round to the upper number for fractional values bigger than 0.5, add 0.5 first.