Rounding macros

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

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

DESCRIPTION

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:
http://en.wikipedia.org/wiki/Rounding#Tie-breaking

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:
http://www.native-instruments.com/forum/showthread.php?t=190461

COMMENTS  (4)

d-rain
6 years ago
Great! Thank you!
Thala Estra
6 years ago
thanks a lot!
Mark Wadewitz
10 years ago
Very useful! Thanks alot!
Jonathan Canupp
11 years ago
Phenomenal, thank you! -tenandtracer
now