}
RETURN;
} /* tried integer divide but it was not an integer result */
- } /* else (abs(result) < 1.0) or (both UVs in range for NV) */
+ } /* else (PERL_ABS(result) < 1.0) or (both UVs in range for NV) */
} /* left wasn't SvIOK */
} /* right wasn't SvIOK */
#endif /* PERL_TRY_UV_DIVIDE */
}
}
+#ifdef __GLIBC__
STATIC
PP(pp_i_modulo_1)
{
-#ifdef __GLIBC__
/* This is the i_modulo with the workaround for the _moddi3 bug
- * in (at least) glibc 2.2.5 (the "right = -right" is the workaround).
+ * in (at least) glibc 2.2.5 (the PERL_ABS() the workaround).
* See below for pp_i_modulo. */
dSP; dATARGET; tryAMAGICbin(modulo,opASSIGN);
{
dPOPTOPiirl;
if (!right)
DIE(aTHX_ "Illegal modulus zero");
- if (right < 0)
- right = -right;
- SETi( left % right );
+ SETi( left % PERL_ABS(right) );
RETURN;
}
-#endif
}
+#endif
PP(pp_i_modulo)
{
PL_ppaddr[OP_I_MODULO] =
&Perl_pp_i_modulo_1;
/* Make certain we work right this time, too. */
- if (right < 0)
- right = -right;
+ right = PERL_ABS(right);
}
}
#endif