* @param mm
   * @param dd
   * @return int
   */
  public static int computeJulianDay(int yyyy, int mm, int dd) {
    { int jul = 0;
      int ja = 0;
      int jy = 0;
      int jm = 0;

      if (yyyy == 0) {
        throw ((StellaException)(StellaException.newStellaException("There is no year zero.").fillInStackTrace()));
      }
      if (mm > 12) {
        { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

          stream000.nativeStream.print("Month `" + mm + "' must be <= 12");
          throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
        }
      }
      if (mm < 0) {
        { OutputStringStream stream001 = OutputStringStream.newOutputStringStream();

          stream001.nativeStream.print("Month `" + mm + "' must be > zero.");
          throw ((StellaException)(StellaException.newStellaException(stream001.theStringReader()).fillInStackTrace()));
        }
      }
      if (dd > 31) {
        { OutputStringStream stream002 = OutputStringStream.newOutputStringStream();

          stream002.nativeStream.print("Day `" + dd + "' must be <= 31");
          throw ((StellaException)(StellaException.newStellaException(stream002.theStringReader()).fillInStackTrace()));
        }
      }
      if (dd < 0) {
        { OutputStringStream stream003 = OutputStringStream.newOutputStringStream();

          stream003.nativeStream.print("Day `" + dd + "' must be > zero.");
          throw ((StellaException)(StellaException.newStellaException(stream003.theStringReader()).fillInStackTrace()));
        }
      }
      if (yyyy < 0) {
        yyyy = yyyy + 1;
      }
      if (mm > 2) {
        {
          jy = yyyy;
          jm = mm + 1;
        }
      }
      else {
        {
          jy = yyyy - 1;
          jm = mm + 13;
        }
      }
      jul = Native.floor(365.25 * jy) + Native.floor(30.6001 * jm) + dd + 1720995;
      if ((dd + (31 * (mm + (12 * yyyy)))) >= (15 + (31 * (10 + (12 * 1582))))) {
        ja = ((int)(0.01 * jy));
        jul = jul + (2 - ja) + ((int)(0.25 * ja));
      }
      return (jul);
    }
  }