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

index 36ce6bc123467c06c02ee2c4f0ef92517b404707..4a74f2c91cb176f300310859a01e022a233ecde5 100644 (file)
@@ -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) {