core/src/main/java/org/jruby/ext/date/RubyDate.java
private static boolean isGregorianLeap(final long year) {
        long uy = (year >= 0) ? year : -year;
        if ((uy & 3) != 0)
            return false;

        long century = uy / 100;
        if (uy != century * 100)
            return true;
        return (century & 3) == 0;
    }
// except for years divisible by 100 and not by 400.
except for years divisible by 100 and not by 400.
except for years divisible by 100 and not by 400 .
private static boolean isGregorianLeap(final long year) {
        long uy = (year >= 0) ? year : -year;
        if ((uy & 3) != 0)
            return false;
        long century = uy / 100;
        if (uy != century * 100)
            return true;
        return (century & 3) == 0;
    }
private static boolean isGregorianLeap ( final long year ) { long uy = ( year >= 0 ) ? year : - year ; if ( ( uy & 3 ) != 0 ) return false ; long century = uy / 100 ; if ( uy != century * 100 ) return true ; return ( century & 3 ) == 0 ; }
except for years divisible by 100 and not by 400.
except for years divisible by 100 and not by 400 .