Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf76f24d

Browse files
committed
Improve computations of interval_div to prevent rounding problem on AIX.
1 parent3dbbbbf commitf76f24d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/backend/utils/adt/timestamp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.144 2005/07/23 14:25:34 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.145 2005/07/23 14:53:21 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -2308,9 +2308,9 @@ interval_div(PG_FUNCTION_ARGS)
23082308
result->day=span->day /factor;
23092309
result->time=span->time /factor;
23102310

2311-
/*Computer remainders */
2312-
month_remainder=(span->month-result->month*factor) /factor;
2313-
day_remainder=(span->day-result->day*factor) /factor;
2311+
/*Compute remainders */
2312+
month_remainder=span->month/factor-result->month;
2313+
day_remainder=span->day/factor-result->day;
23142314

23152315
/* Cascade fractions to lower units */
23162316
/* fractional months full days into days */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp