mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
Change 5e0 to 5.0, for consistency.
This commit is contained in:
parent
220e6bfc53
commit
62abb039df
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.111 2005/07/10 21:13:59 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.112 2005/07/12 15:17:44 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -946,9 +946,9 @@ time2tm(TimeADT time, struct pg_tm * tm, fsec_t *fsec)
|
||||
double trem;
|
||||
|
||||
trem = time;
|
||||
TMODULO(trem, tm->tm_hour, 3600e0);
|
||||
TMODULO(trem, tm->tm_min, 60e0);
|
||||
TMODULO(trem, tm->tm_sec, 1e0);
|
||||
TMODULO(trem, tm->tm_hour, 3600.0);
|
||||
TMODULO(trem, tm->tm_min, 60.0);
|
||||
TMODULO(trem, tm->tm_sec, 1.0);
|
||||
*fsec = trem;
|
||||
#endif
|
||||
|
||||
@ -1683,7 +1683,7 @@ time_part(PG_FUNCTION_ARGS)
|
||||
else if (type == RESERV && val == DTK_EPOCH)
|
||||
{
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
result = (time / 1000000e0);
|
||||
result = (time / 1000000.0);
|
||||
#else
|
||||
result = time;
|
||||
#endif
|
||||
@ -1841,9 +1841,9 @@ timetz2tm(TimeTzADT *time, struct pg_tm * tm, fsec_t *fsec, int *tzp)
|
||||
#else
|
||||
double trem = time->time;
|
||||
|
||||
TMODULO(trem, tm->tm_hour, 3600e0);
|
||||
TMODULO(trem, tm->tm_min, 60e0);
|
||||
TMODULO(trem, tm->tm_sec, 1e0);
|
||||
TMODULO(trem, tm->tm_hour, 3600.0);
|
||||
TMODULO(trem, tm->tm_min, 60.0);
|
||||
TMODULO(trem, tm->tm_sec, 1.0);
|
||||
*fsec = trem;
|
||||
#endif
|
||||
|
||||
@ -2398,12 +2398,12 @@ timetz_part(PG_FUNCTION_ARGS)
|
||||
case DTK_TZ_MINUTE:
|
||||
result = -tz;
|
||||
result /= 60;
|
||||
FMODULO(result, dummy, 60e0);
|
||||
FMODULO(result, dummy, 60.0);
|
||||
break;
|
||||
|
||||
case DTK_TZ_HOUR:
|
||||
dummy = -tz;
|
||||
FMODULO(dummy, result, 3600e0);
|
||||
FMODULO(dummy, result, 3600.0);
|
||||
break;
|
||||
|
||||
case DTK_MICROSEC:
|
||||
@ -2458,7 +2458,7 @@ timetz_part(PG_FUNCTION_ARGS)
|
||||
else if (type == RESERV && val == DTK_EPOCH)
|
||||
{
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
result = time->time / 1000000e0 + time->zone;
|
||||
result = time->time / 1000000.0 + time->zone;
|
||||
#else
|
||||
result = time->time + time->zone;
|
||||
#endif
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.151 2005/06/29 22:51:56 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.152 2005/07/12 15:17:44 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -3278,7 +3278,7 @@ DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct pg_tm * tm,
|
||||
sec = (*fsec / USECS_PER_SEC);
|
||||
*fsec -= (sec * USECS_PER_SEC);
|
||||
#else
|
||||
TMODULO(*fsec, sec, 1e0);
|
||||
TMODULO(*fsec, sec, 1.0);
|
||||
#endif
|
||||
tm->tm_sec += sec;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.130 2005/07/10 21:13:59 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.131 2005/07/12 15:17:44 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1241,9 +1241,9 @@ interval2tm(Interval span, struct pg_tm * tm, fsec_t *fsec)
|
||||
*fsec = (time - (tm->tm_sec * USECS_PER_SEC));
|
||||
#else
|
||||
TMODULO(time, tm->tm_mday, (double)SECS_PER_DAY);
|
||||
TMODULO(time, tm->tm_hour, 3600e0);
|
||||
TMODULO(time, tm->tm_min, 60e0);
|
||||
TMODULO(time, tm->tm_sec, 1e0);
|
||||
TMODULO(time, tm->tm_hour, 3600.0);
|
||||
TMODULO(time, tm->tm_min, 60.0);
|
||||
TMODULO(time, tm->tm_sec, 1.0);
|
||||
*fsec = time;
|
||||
#endif
|
||||
|
||||
@ -3330,7 +3330,7 @@ timestamp_part(PG_FUNCTION_ARGS)
|
||||
{
|
||||
case DTK_MICROSEC:
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
result = tm->tm_sec * 1000000e0 + fsec;
|
||||
result = tm->tm_sec * 1000000.0 + fsec;
|
||||
#else
|
||||
result = (tm->tm_sec + fsec) * 1000000;
|
||||
#endif
|
||||
@ -3338,7 +3338,7 @@ timestamp_part(PG_FUNCTION_ARGS)
|
||||
|
||||
case DTK_MILLISEC:
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
result = tm->tm_sec * 1000e0 + fsec / 1000e0;
|
||||
result = tm->tm_sec * 1000.0 + fsec / 1000.0;
|
||||
#else
|
||||
result = (tm->tm_sec + fsec) * 1000;
|
||||
#endif
|
||||
@ -3346,7 +3346,7 @@ timestamp_part(PG_FUNCTION_ARGS)
|
||||
|
||||
case DTK_SECOND:
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
result = tm->tm_sec + fsec / 1000000e0;
|
||||
result = tm->tm_sec + fsec / 1000000.0;
|
||||
#else
|
||||
result = tm->tm_sec + fsec;
|
||||
#endif
|
||||
@ -3424,7 +3424,7 @@ timestamp_part(PG_FUNCTION_ARGS)
|
||||
result = date2j(tm->tm_year, tm->tm_mon, tm->tm_mday);
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
result += ((((tm->tm_hour * 60) + tm->tm_min) * 60) +
|
||||
tm->tm_sec + (fsec / 1000000e0)) / (double)SECS_PER_DAY;
|
||||
tm->tm_sec + (fsec / 1000000.0)) / (double)SECS_PER_DAY;
|
||||
#else
|
||||
result += ((((tm->tm_hour * 60) + tm->tm_min) * 60) +
|
||||
tm->tm_sec + fsec) / (double)SECS_PER_DAY;
|
||||
@ -3468,7 +3468,7 @@ timestamp_part(PG_FUNCTION_ARGS)
|
||||
errmsg("timestamp out of range")));
|
||||
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
result = (timestamptz - SetEpochTimestamp()) / 1000000e0;
|
||||
result = (timestamptz - SetEpochTimestamp()) / 1000000.0;
|
||||
#else
|
||||
result = timestamptz - SetEpochTimestamp();
|
||||
#endif
|
||||
@ -3560,17 +3560,17 @@ timestamptz_part(PG_FUNCTION_ARGS)
|
||||
case DTK_TZ_MINUTE:
|
||||
result = -tz;
|
||||
result /= 60;
|
||||
FMODULO(result, dummy, 60e0);
|
||||
FMODULO(result, dummy, 60.0);
|
||||
break;
|
||||
|
||||
case DTK_TZ_HOUR:
|
||||
dummy = -tz;
|
||||
FMODULO(dummy, result, 3600e0);
|
||||
FMODULO(dummy, result, 3600.0);
|
||||
break;
|
||||
|
||||
case DTK_MICROSEC:
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
result = tm->tm_sec * 1000000e0 + fsec;
|
||||
result = tm->tm_sec * 1000000.0 + fsec;
|
||||
#else
|
||||
result = (tm->tm_sec + fsec) * 1000000;
|
||||
#endif
|
||||
@ -3578,7 +3578,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
|
||||
|
||||
case DTK_MILLISEC:
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
result = tm->tm_sec * 1000e0 + fsec / 1000e0;
|
||||
result = tm->tm_sec * 1000.0 + fsec / 1000.0;
|
||||
#else
|
||||
result = (tm->tm_sec + fsec) * 1000;
|
||||
#endif
|
||||
@ -3586,7 +3586,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
|
||||
|
||||
case DTK_SECOND:
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
result = tm->tm_sec + fsec / 1000000e0;
|
||||
result = tm->tm_sec + fsec / 1000000.0;
|
||||
#else
|
||||
result = tm->tm_sec + fsec;
|
||||
#endif
|
||||
@ -3652,7 +3652,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
|
||||
result = date2j(tm->tm_year, tm->tm_mon, tm->tm_mday);
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
result += ((((tm->tm_hour * 60) + tm->tm_min) * 60) +
|
||||
tm->tm_sec + (fsec / 1000000e0)) / (double)SECS_PER_DAY;
|
||||
tm->tm_sec + (fsec / 1000000.0)) / (double)SECS_PER_DAY;
|
||||
#else
|
||||
result += ((((tm->tm_hour * 60) + tm->tm_min) * 60) +
|
||||
tm->tm_sec + fsec) / (double)SECS_PER_DAY;
|
||||
@ -3674,7 +3674,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
|
||||
{
|
||||
case DTK_EPOCH:
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
result = (timestamp - SetEpochTimestamp()) /1000000e0;
|
||||
result = (timestamp - SetEpochTimestamp()) /1000000.0;
|
||||
#else
|
||||
result = timestamp - SetEpochTimestamp();
|
||||
#endif
|
||||
@ -3751,7 +3751,7 @@ interval_part(PG_FUNCTION_ARGS)
|
||||
{
|
||||
case DTK_MICROSEC:
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
result = tm->tm_sec * 1000000e0 + fsec;
|
||||
result = tm->tm_sec * 1000000.0 + fsec;
|
||||
#else
|
||||
result = (tm->tm_sec + fsec) * 1000000;
|
||||
#endif
|
||||
@ -3759,7 +3759,7 @@ interval_part(PG_FUNCTION_ARGS)
|
||||
|
||||
case DTK_MILLISEC:
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
result = tm->tm_sec * 1000e0 + fsec / 1000e0;
|
||||
result = tm->tm_sec * 1000.0 + fsec / 1000.0;
|
||||
#else
|
||||
result = (tm->tm_sec + fsec) * 1000;
|
||||
#endif
|
||||
@ -3767,7 +3767,7 @@ interval_part(PG_FUNCTION_ARGS)
|
||||
|
||||
case DTK_SECOND:
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
result = tm->tm_sec + fsec / 1000000e0;
|
||||
result = tm->tm_sec + fsec / 1000000.0;
|
||||
#else
|
||||
result = tm->tm_sec + fsec;
|
||||
#endif
|
||||
@ -3831,7 +3831,7 @@ interval_part(PG_FUNCTION_ARGS)
|
||||
else if (type == RESERV && val == DTK_EPOCH)
|
||||
{
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
result = interval->time / 1000000e0;
|
||||
result = interval->time / 1000000.0;
|
||||
#else
|
||||
result = interval->time;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user