Download Zoom Air IG-4150 Specifications

Transcript
Appendix 2: Displaying Data Formats 85
//
*psMin = (short) (*psSec / 60);
//
*psSec = (short) (*psSec % 60);
//
//
// --- Negative ? --//
//
return(sNeg);
// }
//
// -------------------------------------------------------------//
// static const short DateNGS[12] =
{31,28,31,30,31,30,31,31,30,31,30,31};
// static const short DateLGS[12] =
{31,29,31,30,31,30,31,31,30,31,30,31};
//
// #define NORMAL_YEAR
365
// #define LEAP_YEAR
366
//
// void
// sBreakDate(double dVal,
// Value to break
//
short *psYear,
// Year
//
short *psMonth,
// Month
//
short *psDay)
// Day
// {
//
double dF,dI;
//
short sDays;
//
const short *psMonths;
//
//
short sDay;
//
short sMonth;
//
short sYear;
//
//
// --- Break in the Integer and Fractional Components --//
//
if (dVal < 0.0) dVal = 0.0;
//
dF = modf(dVal,&dI);
//
//
//
// --- Compute the Year --//
//
sYear = (short) dI;
//
if ( (sYear % 4) == 0)
//
{
//
psMonths = DateLGS;
//
sDays
= LEAP_YEAR;
//
} else {
//
psMonths = DateNGS;
//
sDays
= NORMAL_YEAR;
//
}
//
// --- Compute the Day --//
//
sDay = (short) RoundLong(dF * (double) sDays);
//
//
//
// --- Compute the Month --//
//
sMonth = 0;
//
while (sDay >= psMonths[sMonth]) { sDay-= psMonths[sMonth];
sMonth++; }
//
//
//
// --- Ok --//
//
*psYear = sYear;