diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-03-02 09:12:06 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-03-02 09:12:06 +0000 |
commit | 97edce3fcdc8a02187aed95f7b6f4a46eb120a6e (patch) | |
tree | 634dbc4fbaba56944a04f737ce2bf6e715e56a84 /pp.c | |
parent | 224ec32361cf57b93c61b661abceec9635d9d527 (diff) | |
download | perl-97edce3fcdc8a02187aed95f7b6f4a46eb120a6e.tar.gz |
Go with "right = -right" for greater portability, some platforms
might require llabs() to get abs() of long longs.
p4raw-id: //depot/perl@18798
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -2476,14 +2476,16 @@ 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 abs() is the workaround). + * in (at least) glibc 2.2.5 (the "right = -right" is the workaround). * See below for pp_i_modulo. */ dSP; dATARGET; tryAMAGICbin(modulo,opASSIGN); { dPOPTOPiirl; if (!right) DIE(aTHX_ "Illegal modulus zero"); - SETi( left % abs(right) ); + if (right < 0) + right = -right; + SETi( left % right ); RETURN; } #endif @@ -2520,7 +2522,8 @@ PP(pp_i_modulo) PL_ppaddr[OP_I_MODULO] = &Perl_pp_i_modulo_1; /* Make certain we work right this time, too. */ - right = abs(right); + if (right < 0) + right = -right; } } #endif |