Content-Length: 285333 | pFad | http://github.com/postgrespro/postgres_cluster/commit/f76f24dfffe6ed8fe40d29d0af9eae6276612491

68 Improve computations of interval_div to prevent rounding problem on AIX. · postgrespro/postgres_cluster@f76f24d · GitHub
Skip to content

Commit f76f24d

Browse files
committed
Improve computations of interval_div to prevent rounding problem on AIX.
1 parent 3dbbbbf commit f76f24d

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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/f76f24dfffe6ed8fe40d29d0af9eae6276612491

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy