Index: src/OFDate.m ================================================================== --- src/OFDate.m +++ src/OFDate.m @@ -373,11 +373,11 @@ return element; } - (uint32_t)microsecond { - return (uint32_t)nearbyint(remainder(seconds, 1) * 1000000); + return (uint32_t)fmod(seconds * 1000000, 1000000); } - (uint8_t)second { GMTIME_RET(tm_sec) Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -166,11 +166,11 @@ #ifndef _WIN32 if (seconds > UINT_MAX) @throw [OFOutOfRangeException newWithClass: self]; sleep((unsigned int)seconds); - usleep((uint32_t)nearbyint(remainder(seconds, 1) * 1000000)); + usleep((useconds_t)fmod(seconds * 1000000, 1000000)); #else if (seconds * 1000 > UINT_MAX) @throw [OFOutOfRangeException newWithClass: self]; Sleep((unsigned int)(seconds * 1000)); @@ -184,11 +184,11 @@ #ifndef _WIN32 if (seconds > UINT_MAX) @throw [OFOutOfRangeException newWithClass: self]; sleep((unsigned int)seconds); - usleep((uint32_t)nearbyint(remainder(seconds, 1) * 1000000)); + usleep((useconds_t)fmod(seconds * 1000000, 1000000)); #else if (seconds * 1000 > UINT_MAX) @throw [OFOutOfRangeException newWithClass: self]; Sleep((unsigned int)(seconds * 1000));