Divide two integers, returning the floor of the quotient. Unlike the built-in division, this is mathematically well-behaved. E.g., -1/4
=> 0 but floorDivide(-1,4)
=> -1.
- Parameters:
-
| numerator | the numerator |
| denominator | a divisor which must be != 0 |
- Returns:
- the floor of the quotient
Definition at line 27 of file gregoimp.cpp.
Referenced by CECalendar::ceToJD(), ChineseCalendar::computeChineseFields(), Calendar::computeFields(), GregorianCalendar::computeJulianDayOfYear(), Grego::dayOfWeek(), Grego::dayToFields(), Grego::fieldsToDay(), floorDivide(), GregorianCalendar::getEpochDay(), CalendarAstronomer::getSunRiseSet(), Grego::gregorianShift(), IslamicCalendar::handleComputeFields(), GregorianCalendar::handleComputeFields(), IndianCalendar::handleComputeMonthStart(), GregorianCalendar::handleComputeMonthStart(), ChineseCalendar::handleComputeMonthStart(), IndianCalendar::handleGetMonthLength(), GregorianCalendar::handleGetMonthLength(), CECalendar::jdToCE(), CalendarAstronomer::lstToUT(), ChineseCalendar::millisToDays(), Grego::millisToJulianDay(), GregorianCalendar::millisToJulianDay(), IslamicCalendar::monthStart(), GregorianCalendar::setGregorianChange(), Grego::timeToFields(), IslamicCalendar::trueMonthStart(), and IslamicCalendar::yearStart().
{
return (numerator >= 0) ?
numerator / denominator : ((numerator + 1) / denominator) - 1;
}