summaryrefslogtreecommitdiff
path: root/time64.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2014-09-10 11:25:58 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2014-09-10 12:00:16 -0400
commit420331756059a01481dbe54e647de6e49c1d8095 (patch)
treed82f239b8176934a42a64400eb8e5326760481cb /time64.c
parent8e3e9c6c080c2286b374eb44d1e68e86bb970982 (diff)
downloadperl-420331756059a01481dbe54e647de6e49c1d8095.tar.gz
Use the Perl_ math in time64.c, too.
Diffstat (limited to 'time64.c')
-rw-r--r--time64.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/time64.c b/time64.c
index b7ced91739..f0e8d7114d 100644
--- a/time64.c
+++ b/time64.c
@@ -373,19 +373,19 @@ static struct TM *S_gmtime64_r (const Time64_T *in_time, struct TM *p)
p->tm_zone = (char *)"UTC";
#endif
- v_tm_sec = (int)fmod(time, 60.0);
- time = time >= 0 ? floor(time / 60.0) : ceil(time / 60.0);
- v_tm_min = (int)fmod(time, 60.0);
- time = time >= 0 ? floor(time / 60.0) : ceil(time / 60.0);
- v_tm_hour = (int)fmod(time, 24.0);
- time = time >= 0 ? floor(time / 24.0) : ceil(time / 24.0);
+ v_tm_sec = (int)Perl_fmod(time, 60.0);
+ time = time >= 0 ? Perl_floor(time / 60.0) : Perl_ceil(time / 60.0);
+ v_tm_min = (int)Perl_fmod(time, 60.0);
+ time = time >= 0 ? Perl_floor(time / 60.0) : Perl_ceil(time / 60.0);
+ v_tm_hour = (int)Perl_fmod(time, 24.0);
+ time = time >= 0 ? Perl_floor(time / 24.0) : Perl_ceil(time / 24.0);
v_tm_tday = time;
WRAP (v_tm_sec, v_tm_min, 60);
WRAP (v_tm_min, v_tm_hour, 60);
WRAP (v_tm_hour, v_tm_tday, 24);
- v_tm_wday = (int)fmod((v_tm_tday + 4.0), 7.0);
+ v_tm_wday = (int)Perl_fmod((v_tm_tday + 4.0), 7.0);
if (v_tm_wday < 0)
v_tm_wday += 7;
m = v_tm_tday;
@@ -397,7 +397,7 @@ static struct TM *S_gmtime64_r (const Time64_T *in_time, struct TM *p)
if (m >= 0) {
/* Gregorian cycles, this is huge optimization for distant times */
- cycles = (int)floor(m / (Time64_T) days_in_gregorian_cycle);
+ cycles = (int)Perl_floor(m / (Time64_T) days_in_gregorian_cycle);
if( cycles ) {
m -= (cycles * (Time64_T) days_in_gregorian_cycle);
year += (cycles * years_in_gregorian_cycle);
@@ -421,7 +421,7 @@ static struct TM *S_gmtime64_r (const Time64_T *in_time, struct TM *p)
year--;
/* Gregorian cycles */
- cycles = (int)ceil((m / (Time64_T) days_in_gregorian_cycle) + 1);
+ cycles = (int)Perl_ceil((m / (Time64_T) days_in_gregorian_cycle) + 1);
if( cycles ) {
m -= (cycles * (Time64_T) days_in_gregorian_cycle);
year += (cycles * years_in_gregorian_cycle);