From: Ilia Alshanetsky Date: Wed, 6 Jun 2007 23:16:34 +0000 (+0000) Subject: Adjust previous patch to work on all compilers X-Git-Tag: php-5.2.4RC1~393 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d02356922a589443ecd9645df39833d8439f01f3;p=php Adjust previous patch to work on all compilers --- diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 36ce6bc123..4a74f2c91c 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2329,9 +2329,9 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su N = (calc_sunset ? h_set : h_rise) + gmt_offset; if (N > 24) { - N %= 24; + N -= floor(N / 24) * N; } else if (N < 0) { - N = N % 24 + 24; + N = floor(N / 24) * -N + 24; } switch (retformat) {