From: Ilia Alshanetsky Date: Wed, 6 Jun 2007 23:16:45 +0000 (+0000) Subject: MFB: Adjust previous patch to work on all compilers X-Git-Tag: BEFORE_IMPORT_OF_MYSQLND~499 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d13cd37be8e2824eb53c1cddc047760b7e00e48;p=php MFB: Adjust previous patch to work on all compilers --- diff --git a/ext/date/php_date.c b/ext/date/php_date.c index ea70ec3562..6654618bd9 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2486,9 +2486,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) {