Logo Search packages:      
Sourcecode: icu version File versions

UBool HebrewCalendar::isLeapYear ( int32_t  year ) [static]

Determine whether a given Hebrew year is a leap year

The rule here is that if (year % 19) == 0, 3, 6, 8, 11, 14, or 17. The formula below performs the same test, believe it or not.

Definition at line 471 of file hebrwcal.cpp.

Referenced by add(), handleComputeFields(), handleComputeMonthStart(), roll(), startOfYear(), SimpleDateFormat::subFormat(), and SimpleDateFormat::subParse().

                                             {
    //return (year * 12 + 17) % 19 >= 12;
    int32_t x = (year*12 + 17) % 19;
    return x >= ((x < 0) ? -7 : 12);
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index