Index: ./src/backend/utils/adt/timestamp.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v retrieving revision 1.60 diff -c -r1.60 timestamp.c *** ./src/backend/utils/adt/timestamp.c 21 Nov 2001 18:29:48 -0000 1.60 --- ./src/backend/utils/adt/timestamp.c 24 Nov 2001 18:45:59 -0000 *************** *** 2568,2578 **** break; case DTK_MICROSEC: ! result = (fsec * 1000000); break; case DTK_MILLISEC: ! result = (fsec * 1000); break; case DTK_SECOND: --- 2568,2589 ---- break; case DTK_MICROSEC: ! /* XXX: is there a better way? */ ! /* without the cast through int, we end up returning ! * values like "446907.989501953" from float8out. If ! * there is better way, please fix this busted code. ! * This is might only be fixing a symptom of the real ! * problem. -- dbv 20011124 ! */ ! result = rint( fsec * 1000000 ); break; case DTK_MILLISEC: ! /* XXX: is there a better way? */ ! /* as above, if we don't condition this result, we end up ! * returning incorrect values from float8out. -- dbv 20011124 ! */ ! result = ( rint( fsec * 1000000 ) / 1000.0 ); break; case DTK_SECOND: