From: Rafael Garcia-Suarez Date: Fri, 13 Mar 2009 12:15:16 +0000 (+0100) Subject: Ignore the decimal part of any floating point argument passed to localtime or gmtime X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7a67abdf144958503a96be280e967853af1af745;p=p5sagit%2Fp5-mst-13.2.git Ignore the decimal part of any floating point argument passed to localtime or gmtime That way the overload warning won't be emitted for non-overflowing floating point values. --- diff --git a/pp_sys.c b/pp_sys.c index fa0c79a..b42cced 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -4464,7 +4464,7 @@ PP(pp_gmtime) using a double causes an unfortunate loss of accuracy on high numbers. What we really need is an SvQV. */ - double input = POPn; + double input = Perl_floor(POPn); when = (Time64_T)input; if (when != input && ckWARN(WARN_OVERFLOW)) { Perl_warner(aTHX_ packWARN(WARN_OVERFLOW),