rintf produces incorrect rounding result -1034.5 rounds to -1034.0

EDIT: I was mistaken.

After some more experimentation, it seems like even numbers + 0.5 are rounded towards 0 while odd numbers + 0.5 are rounded away from zero. Is this the intended behavior?

Since rintf() is implementing the functionality of the C library version of the same method: man rintf

OK, I guess that isn’t very helpful if you don’t know what the rounding mode on the GPU is… IIRC, most operations default to round to nearest even unless you explicitly call the function with a rounding suffix (See appendix B.2). I’m not sure if rintf can be called with these suffixes, though…

The mode is round-to-nearest-or-even. So, +/-5.5 rounds away from zero, +/-1034.5 rounds towards zero. rintf() is also faster than roundf(). It’s not an incorrect result–it’s fully C99 and IEEE 754 compliant. What you can’t do is change the rounding mode.