This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Reinstate part of #28744 that was accidentally reverted in #30454
[perl5.git] / ext / Math / BigInt / FastCalc / FastCalc.xs
index 152eb0b..3e53876 100644 (file)
@@ -381,15 +381,15 @@ _len(class,x)
   INIT:
     AV*        a;
     SV*        temp;
-    NV elems;
+    IV elems;
     STRLEN len;
 
   CODE:
     a = (AV*)SvRV(x);                  /* ref to aray, don't check ref */
-    elems = (NV) av_len(a);            /* number of elems in array */
+    elems = av_len(a);                 /* number of elems in array */
     temp = *av_fetch(a, elems, 0);     /* fetch last element */
     SvPV(temp, len);                   /* convert to string & store length */
-    len += XS_BASE_LEN * elems;
+    len += (IV) XS_BASE_LEN * elems;
     ST(0) = newSViv(len);
 
 ##############################################################################