亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dateopsintl.cpp

?? This is a pgm can be used for astronomy
?? CPP
字號:
/*****************************************************************************\
 * DateOps.cpp
 *
 * DateOps contains misc. time and date operations
 *
 * author: mark huss (mark@mhuss.com)
 * Based on Bill Gray's open-source code at projectpluto.com
 *
\*****************************************************************************/

#include "DateOps.h"

#include <string.h>

// see general calendarical comments in DateOps.cpp

#if defined( CALENDARS_OF_THE_WORLD )

/* The following mod( ) function returns the _positive_ remainder after */
/* a division.  Annoyingly,  if x < 0,  then x % y <= 0;  thus,  this   */
/* function is needed for things such as determining a day of the week. */

long DateOps::mod( long x, long y )
{
   long rval = x % y;

   if( rval < 0L )
      rval += y;

   return rval;
}

void DateOps::getIslamicYearData( long year, long& daysInYear, MonthDays& md )
      // long *days, char *month_data)
{
   static const long THIRTY_ISLAMIC_YEARS = 10631L;

   static const int isIslamicLeapYear[30] = {
           0, 0, 1, 0, 0, 1, 0, 1, 0, 0,
           1, 0, 0, 1, 0, 0, 1, 0, 1, 0,
           0, 1, 0, 0, 1, 0, 1, 0, 0, 1 };

   long yearWithinCycle = mod( year, 30L );
   long thirtyYearCycles = (year - yearWithinCycle) / 30L;
   long rval = E_ISLAMIC +
               thirtyYearCycles * THIRTY_ISLAMIC_YEARS +
               yearWithinCycle * 354L;

   md[12] = 0;
   md[11] = 29 + isIslamicLeapYear[yearWithinCycle];
   while( yearWithinCycle-- )
      rval += long( isIslamicLeapYear[yearWithinCycle] );

   daysInYear = rval;

   /* The Islamic calendar alternates between 30-day and 29-day */
   /* months for the first eleven months;  the twelfth is 30    */
   /* days in a leap year,  29 otherwise (see above).           */

   for( int i=0; i<11; i++ )
      md[i] = 30 - (i % 2);
}

/* End:  Islamic calendar */


/* Begin:  Hebrew calendar */

/* See p 586,  _Explanatory Supplement_,  for explanation. */
/* There are 1080 Halakim,  or 'parts',  each 3.33 seconds long,  in  */
/* an hour.  So: */

static const int isHebrewLeapYear[19] = { 0, 0, 1, 0, 0, 1,
           0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1 };

long DateOps::lunationsToTishri1( long year )
{
   long yearWithinCycle = mod( year - 1, 19L );

   long fullNineteenYearCycles = ( year - 1 - yearWithinCycle ) / 19L;

   long rval = fullNineteenYearCycles * 235L + yearWithinCycle * 12L;

   for( int y=0; y<yearWithinCycle; y++ )
      rval += isHebrewLeapYear[y];

   return rval;
}

void DateOps::lunationsToDaysAndHalakim( long lunations, long& days, long& halakim )
{
   /*****
   One lunation is 29 days, 13753 halakim long.  To evade integer
   overflow for immense numbers of lunations,  we can use the fact
   that 25920 lunations is exactly 765433 days.  This cycle has no
   name that I know of,  and no real significance outside of this
   particular function... but it _does_ let us write simpler code
   that won't get wrong answers for large or negative numbers of
   lunations.  Let's call 25920 lunations a "glumph."  We figure
   out how many glumphs have passed and our location within that
   glumph,  and the rest is easy.
   *****/

   long lunationWithinGlumph = mod( lunations, 25920L );

   long currGlumph = ( lunations - lunationWithinGlumph ) / 25920L;

   days += currGlumph * 765433L + lunationWithinGlumph * 29L;
   halakim += lunationWithinGlumph * 13753L;

   // Now make sure excess halakim carry over correctly
   days += halakim / HALAKIM_IN_DAY;
   halakim %= HALAKIM_IN_DAY;
}

/* Set days and halakim to the 'epoch':  1 Tishri 1 = 2 5604 */
void DateOps::findTishri1( long year, long& days, long& halakim )
{
   days = 2L;
   halakim = 5604L;
   lunationsToDaysAndHalakim( lunationsToTishri1( year), days, halakim );
}

/* Warning: Certain aspects of getHebrewYearData( ) will definitely fail for
   years before zero... something will have to be done about that.
*/

void DateOps::getHebrewYearData( long year, YearEndDays& daysInYear, MonthDays& md )
{
   for( int i=0; i<2; i++ ) {
      long day, halakim;

      findTishri1( year + i, day, halakim );

      /* Check dehiyyah (c): */
      if( 3 == mod( day, 7L ) &&
          halakim >= 9L * 1080L + 204L &&
          !isHebrewLeapYear[ mod( year - 1 + i, 19L) ]
        )
      {
         day += 2;
      }
      /* Check dehiyyah (d): */
      else if( mod( day, 7L) == 2 &&
               halakim >= 15L * 1080L + 589L &&
               isHebrewLeapYear[ mod( year - 2 + i, 19L) ]
              )
      {
         day++;
      }
      else
      {
         if( halakim > 18L * 1080L )
            day++;

         if( mod( day, 7L ) == 1 ||
             mod( day, 7L ) == 4 ||
             mod( day, 7L ) == 6L
           )
         {
            day++;
         }
      }
      daysInYear[i] = day + E_HEBREW;
   }

   int yearLength = int( daysInYear[1] - daysInYear[0] );

   if( 0 != md[0] ) {
      for( int i=0; i<6; i++ )                 /* "normal" lengths */
         md[i] = md[i + 7] = (char)( 30 - (i & 1));

      if( isHebrewLeapYear[ mod( year - 1, 19L) ] ) {
         md[5] = 30;     /* Adar I is bumped up a day in leap years */
         md[6] = 29;
      }
      else                       /* In non-leap years,  Adar II doesn't    */
         md[6] = 0;      /* exist at all;  set it to zero days     */

      if( yearLength == 353 || yearLength == 383 )      /* deficient year */
         md[2] = 29;

      if( yearLength == 355 || yearLength == 385 )      /* complete year  */
         md[1] = 30;
   }
}

/*  Some test cases:  16 Av 5748 AM (16 12 5748) = 30 Jul 1988 Gregorian */
/*                 14 Nisan 5730 AM (14 8 5730) = 20 Apr 1970 Gregorian */
/*                  1 Tishri 5750 AM (1 1 5750) = 30 Sep 1989 Gregorian */

/* End:  Hebrew calendar */

/* Begin:  (French) Revolutionary calendar */

/*
The French Revolutionary calendar is simplest,  in some respects;
you just have twelve months,  each of 30 days,  with five or six
"unattached" days at the end of the year.  Leap years are those
divisible by four,  except for those divisible by 128.  This slight
deviation from the Gregorian scheme,  of "divisible by four,  unless
divisible by 100,  unless divisible by 400",  is slightly simpler
and gives a calendar that is _much_ closer to the true tropical year.

Unfortunately,  when first devised,  the French attempted to have
New Years Day line up with the autumn equinox,  which is not
particularly regular.  Thus, between 1 AR and 20 AR,  leap years
occurred a year early;  i.e, years 3, 7, 11,  and 15 AR were leap
years;  after that,  they were supposed to revert to the rule
described above.  (There are also claims that leap years were to
follow the Gregorian "4, 100, 400" rule.  I have no real evidence
to support one scheme over the other.  But I suspect that a revolution
so devoted to revising every aspect of human existence that it
changed names of all months,  "regularized" each to be 30 days,  and
made a week ten days long,  probably went out of its way not to
resemble earlier calendars proposed by a Pope.  Also,  the fact that
it would be an almost perfect match to the tropical year would lend
support to the scheme.  Finally,  the irony of the Republic creating
a calendar that would be good for a hundred thousand years appeals
to me,  considering the short life of the Republic itself.  Those
objecting to my choice are free to #define GREGORIAN_REVOLUTIONARY.)

   A 'proleptic' calendar wasn't defined,  to my knowledge...
I've added one based on the logical assumption that zero,  and all
"BR" (Before the Revolution) years divisible by four and not by 128,
are leap;  so (as with all other calendars in this code) negative
years are correctly supported.

*/

long DateOps::jdOfFrenchRevYear( long year )
{
   long rval = E_REVOLUTIONARY + year * 365L;

   if( year >= 20)
      year--;

#ifdef GREGORIAN_REVOLUTIONARY
   rval += long(year / 4 - year / 100 + year / 400);
#else
   rval += long(year / 4 - year / 128);
#endif

   if( year <= 0L )
      rval--;

   return rval;
}

void DateOps::getRevolutionaryYearData( long year, YearEndDays& daysInYear,
                                        MonthDays& md )
{
   daysInYear[0] = jdOfFrenchRevYear( year );
   daysInYear[1] = jdOfFrenchRevYear( year + 1 );

   /* There are twelve months of 30 days each,  followed by
    * five (leap years,  six) days;  call 'em an extra
    * thirteenth "month",  containing all remaining days:
    */
   for( int i=0; i<12; i++ )
      md[i] = 30;

   md[12] = ( daysInYear[1] - daysInYear[0] - 360L );
}

/* End:  (French) Revolutionary calendar */

/* Begin:  Persian (Jalaali) calendar */

long DateOps::jalaliJd0( long jalaliYear )
{
   static const int breaks[12] = { -708, -221,   -3,    6,  394,  720,
                                    786, 1145, 1635, 1701, 1866, 2328 };
   static const int deltas[12] = { 1108, 1047,  984, 1249,  952,  891,
                                   930,  866,  869,  844,  848,  852 };
   long rval = -1L;

   if( jalaliYear >= LOWER_PERSIAN_YEAR ) {

      for( int i = 0; i < 12; i++ ) {
         if( jalaliYear < breaks[i] )
         {
            rval = JALALI_ZERO + jalaliYear * 365L +
                   ( deltas[i] + jalaliYear * 303L ) / 1250L;

            if( i < 3 )  /* zero point drops one day in first three blocks */
               rval--;

            break;
         }
      }
   }
   return rval;
}

void DateOps::getJalaliYearData( long year, YearEndDays& daysInYear, MonthDays& md )
{
   if( year < LOWER_PERSIAN_YEAR || year > UPPER_PERSIAN_YEAR)
      return;

   daysInYear[0] = jalaliJd0( year) + 1L;
   daysInYear[1] = jalaliJd0( year + 1L ) + 1L;

   /* The first six months have 31 days.
    * The next five have 30 days.
    * The last month has 29 days in ordinary years,  30 in leap years.
    */
   for( int i=0; i<6; i++ )
      md[i] = 31;

   for( int i=6; i<11; i++ )
      md[i] = 30;

   md[11] = ( daysInYear[1] - daysInYear[0] - 336L );
}

/* End:  Persian (Jalali) calendar */

#endif  /* #if defined( CALENDARS_OF_THE_WORLD ) */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
自拍偷拍国产精品| 蜜桃精品视频在线| 国产精品麻豆久久久| 精品成人免费观看| 久久亚洲精品小早川怜子| 亚洲视频电影在线| 蜜桃视频一区二区三区在线观看| 狠狠狠色丁香婷婷综合久久五月| 9久草视频在线视频精品| 欧美日韩精品免费观看视频 | 亚洲永久精品大片| 欧美制服丝袜第一页| 7777精品久久久大香线蕉| 欧美精品一区二区三区四区| 欧美国产视频在线| 偷拍亚洲欧洲综合| 国产成人亚洲精品青草天美| 欧美网站大全在线观看| 久久精品亚洲麻豆av一区二区 | 国产福利91精品| 在线免费观看日本一区| 国产日韩亚洲欧美综合| 亚洲国产精品久久艾草纯爱| 成人美女在线视频| 欧美精品777| 亚洲精品中文在线影院| 国产精品综合在线视频| 538在线一区二区精品国产| 亚洲色图视频网| 蜜桃精品视频在线观看| 欧美日韩亚洲综合一区二区三区| 国产精品久久久久一区二区三区 | 91麻豆精品久久久久蜜臀| 亚洲黄色尤物视频| 91小视频免费观看| 一区二区三区免费网站| 色久优优欧美色久优优| 亚洲成人在线观看视频| 欧美日韩大陆一区二区| 日本va欧美va欧美va精品| 日韩精品中文字幕一区| 国产综合色视频| 国产精品私人自拍| 色综合视频一区二区三区高清| 亚洲欧美经典视频| 欧美日韩中文一区| 免费成人在线观看| 中文字幕免费观看一区| 91精品91久久久中77777| 亚洲成a人v欧美综合天堂下载| 欧美性感一类影片在线播放| 日本美女一区二区三区视频| 久久久亚洲精品一区二区三区| 成人免费视频视频| 亚洲成人免费av| 欧美tickle裸体挠脚心vk| 国产成人av一区二区| 亚洲激情成人在线| 精品日韩在线一区| 不卡电影免费在线播放一区| 亚洲第一福利视频在线| 日韩美女视频在线| 99久精品国产| 免费人成在线不卡| 亚洲图片激情小说| 欧美电影影音先锋| 成年人网站91| 日韩影视精彩在线| 中文字幕乱码久久午夜不卡 | 五月天亚洲婷婷| 久久精品在这里| 欧美性一级生活| 国产老妇另类xxxxx| 亚洲综合激情另类小说区| 亚洲精品在线观| 在线观看欧美精品| 春色校园综合激情亚洲| 男男视频亚洲欧美| 日韩一区在线播放| 久久久久久夜精品精品免费| 欧美日韩中文另类| 成人免费毛片aaaaa**| 人人狠狠综合久久亚洲| 又紧又大又爽精品一区二区| 国产午夜精品福利| 日韩一级免费一区| 欧美私人免费视频| www.亚洲激情.com| 国产精品亚洲午夜一区二区三区| 爽好多水快深点欧美视频| 欧美国产激情一区二区三区蜜月| 日韩视频国产视频| 欧美日韩亚洲综合在线| 在线看一区二区| 99精品国产99久久久久久白柏| 国产精品一区二区在线播放| 日本aⅴ精品一区二区三区| 一片黄亚洲嫩模| 最新日韩在线视频| 国产精品人人做人人爽人人添| 精品国产一二三区| 精品精品欲导航| 精品少妇一区二区三区日产乱码 | 久久精品国产精品亚洲红杏| 亚洲国产精品久久人人爱蜜臀| 成人免费小视频| 国产精品福利一区二区三区| 国产精品亲子伦对白| 国产校园另类小说区| 久久久久国产精品厨房| 久久午夜免费电影| 久久久久久免费| 久久夜色精品国产噜噜av| 久久综合久久综合亚洲| 久久久噜噜噜久噜久久综合| 久久久久久亚洲综合| 久久久久国产精品免费免费搜索| 精品福利在线导航| 精品av综合导航| 久久久精品中文字幕麻豆发布| 日韩免费福利电影在线观看| 精品国产乱码久久久久久图片| 精品日韩成人av| 日本一区二区三区久久久久久久久不| 免费精品视频在线| 美腿丝袜亚洲三区| 国产一区欧美日韩| 91视频xxxx| 91精品午夜视频| 久久综合色之久久综合| 中文字幕日本乱码精品影院| 亚洲你懂的在线视频| 亚洲成av人片| 激情图区综合网| 91在线国产福利| 欧美色精品在线视频| 精品国产电影一区二区| 中文字幕精品一区二区三区精品| 中文字幕视频一区二区三区久| 亚洲一区二区精品久久av| 日韩av中文字幕一区二区三区| 麻豆免费看一区二区三区| av欧美精品.com| 欧美高清hd18日本| 国产欧美日韩在线| 亚洲国产精品视频| 成人小视频免费在线观看| 一本久久精品一区二区| 精品久久久久久亚洲综合网| 国产精品久久夜| 强制捆绑调教一区二区| av亚洲精华国产精华精华| 欧美男女性生活在线直播观看| 2020日本不卡一区二区视频| 一区二区在线观看视频| 久久国产精品99精品国产| 91丨porny丨户外露出| 日韩丝袜情趣美女图片| 中文字幕一区二区日韩精品绯色| 午夜精品一区在线观看| 99视频精品在线| 精品剧情在线观看| 亚洲影院在线观看| 成人福利在线看| 欧美v日韩v国产v| 午夜激情综合网| 91麻豆swag| 国产欧美精品区一区二区三区 | 五月婷婷综合网| 色综合久久久久网| 久久久久久毛片| 激情欧美一区二区三区在线观看| 色国产精品一区在线观看| 久久精品一二三| 国精产品一区一区三区mba视频| 欧美日韩国产成人在线免费| 亚洲人成亚洲人成在线观看图片| 久久精品国产精品亚洲精品| 欧美日韩亚洲高清一区二区| 亚洲色图在线看| www.av精品| 国产精品高潮呻吟久久| 国产高清精品久久久久| 久久久久久免费网| 国产在线一区二区综合免费视频| 欧美精品三级日韩久久| 亚洲电影在线免费观看| 在线欧美日韩国产| 一区二区三区不卡视频在线观看 | 综合欧美亚洲日本| 国产精品66部| 久久久久亚洲蜜桃| 国产美女久久久久| 国内精品伊人久久久久影院对白| 欧美丰满美乳xxx高潮www| 亚洲第一综合色| 91麻豆精品国产综合久久久久久| 亚洲午夜av在线| 制服丝袜亚洲色图| 日本不卡的三区四区五区|