]> granicus.if.org Git - php/commitdiff
MFB: Adjust previous patch to work on all compilers
authorIlia Alshanetsky <iliaa@php.net>
Wed, 6 Jun 2007 23:16:45 +0000 (23:16 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 6 Jun 2007 23:16:45 +0000 (23:16 +0000)
ext/date/php_date.c

index ea70ec3562a37a7e018a9b6172f40cfc5b1292dd..6654618bd98e282c1541245058f65247b341a475 100644 (file)
@@ -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) {