summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2009-03-13 13:15:16 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2009-03-13 13:15:16 +0100
commit7a67abdf144958503a96be280e967853af1af745 (patch)
tree3aab7fb6fcc71a083f42e388dc5244a4482d9949 /pp_sys.c
parent05fe29fd3bc243a33acdc8a62bc4ce42df75ca4b (diff)
downloadperl-7a67abdf144958503a96be280e967853af1af745.tar.gz
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.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp_sys.c b/pp_sys.c
index fa0c79a8e6..b42cced0e2 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),