Use rint() instead of nearbyint().

nearbyint() is missing on some systems, even though it is part of C99
and POSIX.