code: protected int handleComputeMonthStart(int eyear, int month, boolean useMonth) {
  
          // Resolve out-of-range months.  This is necessary in order to
          // obtain the correct year.  We correct to
          // a 12- or 13-month year (add/subtract 12 or 13, depending
          // on the year) but since we _always_ number from 0..12, and
          // the leap year determines whether or not month 5 (Adar 1)
          // is present, we allow 0..12 in any given year.
          while (month < 0) {
              month += monthsInYear(--eyear);
          }
          // Careful: allow 0..12 in all years
          while (month > 12) {
              month -= monthsInYear(eyear++);
          }
  
          long day = startOfYear(eyear);
  
          if (month != 0) {
              if (isLeapYear(eyear)) {
                  day += LEAP_MONTH_START[month][yearType(eyear)];
              } else {
                  day += MONTH_START[month][yearType(eyear)];
              }
          }
  
          return (int) (day + 347997);
      }
docs: Return JD of start of given month/year.