88 *
99 *
1010 * IDENTIFICATION
11- * $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.130 2005/07/10 21:13:59 tgl Exp $
11+ * $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.131 2005/07/12 15:17:44 momjian Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -1241,9 +1241,9 @@ interval2tm(Interval span, struct pg_tm * tm, fsec_t *fsec)
12411241* fsec = (time - (tm -> tm_sec * USECS_PER_SEC ));
12421242#else
12431243TMODULO (time ,tm -> tm_mday , (double )SECS_PER_DAY );
1244- TMODULO (time ,tm -> tm_hour ,3600e0 );
1245- TMODULO (time ,tm -> tm_min ,60e0 );
1246- TMODULO (time ,tm -> tm_sec ,1e0 );
1244+ TMODULO (time ,tm -> tm_hour ,3600.0 );
1245+ TMODULO (time ,tm -> tm_min ,60.0 );
1246+ TMODULO (time ,tm -> tm_sec ,1.0 );
12471247* fsec = time ;
12481248#endif
12491249
@@ -3330,23 +3330,23 @@ timestamp_part(PG_FUNCTION_ARGS)
33303330{
33313331case DTK_MICROSEC :
33323332#ifdef HAVE_INT64_TIMESTAMP
3333- result = tm -> tm_sec * 1000000e0 + fsec ;
3333+ result = tm -> tm_sec * 1000000.0 + fsec ;
33343334#else
33353335result = (tm -> tm_sec + fsec )* 1000000 ;
33363336#endif
33373337break ;
33383338
33393339case DTK_MILLISEC :
33403340#ifdef HAVE_INT64_TIMESTAMP
3341- result = tm -> tm_sec * 1000e0 + fsec /1000e0 ;
3341+ result = tm -> tm_sec * 1000.0 + fsec /1000.0 ;
33423342#else
33433343result = (tm -> tm_sec + fsec )* 1000 ;
33443344#endif
33453345break ;
33463346
33473347case DTK_SECOND :
33483348#ifdef HAVE_INT64_TIMESTAMP
3349- result = tm -> tm_sec + fsec /1000000e0 ;
3349+ result = tm -> tm_sec + fsec /1000000.0 ;
33503350#else
33513351result = tm -> tm_sec + fsec ;
33523352#endif
@@ -3424,7 +3424,7 @@ timestamp_part(PG_FUNCTION_ARGS)
34243424result = date2j (tm -> tm_year ,tm -> tm_mon ,tm -> tm_mday );
34253425#ifdef HAVE_INT64_TIMESTAMP
34263426result += ((((tm -> tm_hour * 60 )+ tm -> tm_min )* 60 )+
3427- tm -> tm_sec + (fsec /1000000e0 )) / (double )SECS_PER_DAY ;
3427+ tm -> tm_sec + (fsec /1000000.0 )) / (double )SECS_PER_DAY ;
34283428#else
34293429result += ((((tm -> tm_hour * 60 )+ tm -> tm_min )* 60 )+
34303430tm -> tm_sec + fsec ) / (double )SECS_PER_DAY ;
@@ -3468,7 +3468,7 @@ timestamp_part(PG_FUNCTION_ARGS)
34683468errmsg ("timestamp out of range" )));
34693469
34703470#ifdef HAVE_INT64_TIMESTAMP
3471- result = (timestamptz - SetEpochTimestamp ()) /1000000e0 ;
3471+ result = (timestamptz - SetEpochTimestamp ()) /1000000.0 ;
34723472#else
34733473result = timestamptz - SetEpochTimestamp ();
34743474#endif
@@ -3560,33 +3560,33 @@ timestamptz_part(PG_FUNCTION_ARGS)
35603560case DTK_TZ_MINUTE :
35613561result = - tz ;
35623562result /=60 ;
3563- FMODULO (result ,dummy ,60e0 );
3563+ FMODULO (result ,dummy ,60.0 );
35643564break ;
35653565
35663566case DTK_TZ_HOUR :
35673567dummy = - tz ;
3568- FMODULO (dummy ,result ,3600e0 );
3568+ FMODULO (dummy ,result ,3600.0 );
35693569break ;
35703570
35713571case DTK_MICROSEC :
35723572#ifdef HAVE_INT64_TIMESTAMP
3573- result = tm -> tm_sec * 1000000e0 + fsec ;
3573+ result = tm -> tm_sec * 1000000.0 + fsec ;
35743574#else
35753575result = (tm -> tm_sec + fsec )* 1000000 ;
35763576#endif
35773577break ;
35783578
35793579case DTK_MILLISEC :
35803580#ifdef HAVE_INT64_TIMESTAMP
3581- result = tm -> tm_sec * 1000e0 + fsec /1000e0 ;
3581+ result = tm -> tm_sec * 1000.0 + fsec /1000.0 ;
35823582#else
35833583result = (tm -> tm_sec + fsec )* 1000 ;
35843584#endif
35853585break ;
35863586
35873587case DTK_SECOND :
35883588#ifdef HAVE_INT64_TIMESTAMP
3589- result = tm -> tm_sec + fsec /1000000e0 ;
3589+ result = tm -> tm_sec + fsec /1000000.0 ;
35903590#else
35913591result = tm -> tm_sec + fsec ;
35923592#endif
@@ -3652,7 +3652,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
36523652result = date2j (tm -> tm_year ,tm -> tm_mon ,tm -> tm_mday );
36533653#ifdef HAVE_INT64_TIMESTAMP
36543654result += ((((tm -> tm_hour * 60 )+ tm -> tm_min )* 60 )+
3655- tm -> tm_sec + (fsec /1000000e0 )) / (double )SECS_PER_DAY ;
3655+ tm -> tm_sec + (fsec /1000000.0 )) / (double )SECS_PER_DAY ;
36563656#else
36573657result += ((((tm -> tm_hour * 60 )+ tm -> tm_min )* 60 )+
36583658tm -> tm_sec + fsec ) / (double )SECS_PER_DAY ;
@@ -3674,7 +3674,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
36743674{
36753675case DTK_EPOCH :
36763676#ifdef HAVE_INT64_TIMESTAMP
3677- result = (timestamp - SetEpochTimestamp ()) /1000000e0 ;
3677+ result = (timestamp - SetEpochTimestamp ()) /1000000.0 ;
36783678#else
36793679result = timestamp - SetEpochTimestamp ();
36803680#endif
@@ -3751,23 +3751,23 @@ interval_part(PG_FUNCTION_ARGS)
37513751{
37523752case DTK_MICROSEC :
37533753#ifdef HAVE_INT64_TIMESTAMP
3754- result = tm -> tm_sec * 1000000e0 + fsec ;
3754+ result = tm -> tm_sec * 1000000.0 + fsec ;
37553755#else
37563756result = (tm -> tm_sec + fsec )* 1000000 ;
37573757#endif
37583758break ;
37593759
37603760case DTK_MILLISEC :
37613761#ifdef HAVE_INT64_TIMESTAMP
3762- result = tm -> tm_sec * 1000e0 + fsec /1000e0 ;
3762+ result = tm -> tm_sec * 1000.0 + fsec /1000.0 ;
37633763#else
37643764result = (tm -> tm_sec + fsec )* 1000 ;
37653765#endif
37663766break ;
37673767
37683768case DTK_SECOND :
37693769#ifdef HAVE_INT64_TIMESTAMP
3770- result = tm -> tm_sec + fsec /1000000e0 ;
3770+ result = tm -> tm_sec + fsec /1000000.0 ;
37713771#else
37723772result = tm -> tm_sec + fsec ;
37733773#endif
@@ -3831,7 +3831,7 @@ interval_part(PG_FUNCTION_ARGS)
38313831else if (type == RESERV && val == DTK_EPOCH )
38323832{
38333833#ifdef HAVE_INT64_TIMESTAMP
3834- result = interval -> time /1000000e0 ;
3834+ result = interval -> time /1000000.0 ;
38353835#else
38363836result = interval -> time ;
38373837#endif