This page is available in English only

Rounding macros

Various round to nearest integer macros implementing different tie breaking rules.

(10 Votes)
1.1 (Updated 8 years ago)
April 22, 2013
Reaktor 5 or lower


These core macros all round to the nearest integer (for floor, ceiling, truncate, please look elsewhere). They differ in what they do with 'ties' i.e. 0.5, 2.5. -4.5...

The Reaktor default is 'round to nearest ties to even which is the IEEE 754 standard default, but not usually what you want or expect in Reaktor.

These macros implement the other round to nearest integer version as described here:

Some of them seem complex internally, but are the most efficient implementations I could come up with after quite a bit of hacking. See this thread for details:


2 years ago
Great! Thank you!
Thala Estra
2 years ago
thanks a lot!
Mark Wadewitz
6 years ago
Very useful! Thanks alot!
Jonathan Canupp
8 years ago
Phenomenal, thank you! -tenandtracer