|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-05-26 11:08 UTC] pickett at sumu dot org
Description: ------------ Fix for bug #27172 broke hexadecimal string modulos for gmp_powm(). Reproduce code: --------------- var_dump(gmp_powm("0x1", "0x1", "0x1")) Expected result: ---------------- resource(4) of type (GMP integer) Actual result: -------------- bool(false) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 03:00:01 2025 UTC |
Here's a fix --- php-4.3.7RC1/ext/gmp/gmp.c 2004-02-16 17:13:49.000000000 +0200 +++ php-4.3.7RC1/ext/gmp/gmp.c 2004-05-28 12:56:59.000000000 +0300 @@ -830,8 +830,7 @@ } FETCH_GMP_ZVAL(gmpnum_mod, mod_arg); - convert_to_long_ex(mod_arg); - if (!Z_LVAL_PP(mod_arg)) { + if(mpz_cmp_ui(*gmpnum_mod, 0) == 0) { RETURN_FALSE; }