Commit Graph

49 Commits

Author SHA1 Message Date
Stanislav Malyshev
afdaedaa26 Merge branch 'PHP-5.6'
* PHP-5.6:
  update NEWS and UPGRADING
  Upated NEWS
  Address issues raised by @nikic
  Make sure min < max
  Mersenne Twister was added in GMP 4.2
  Add test files
  Add gmp_random_bits(bits) and gmp_random_range(min, max)
  Change GMPs default PRNG to Mersenne Twister

Conflicts:
	ext/gmp/gmp.c
2014-10-14 00:43:15 -07:00
Nikita Popov
bb0c142156 Drop support for GMP 4.1
* Consistent base conversion support (max: 62)
 * mpz_remroot always available
 * Use gmp_randinit_mt instead of LCG
2014-09-28 20:46:22 +02:00
Leigh
581c86c07f Make gmp_setbit and gmp_clrbit return values consistent 2014-09-28 20:18:14 +02:00
Leigh
adf8f0f284 Address issues raised by @nikic
- Thread safety on rand init function.
 - Ret false on validation failure
 - Add _dep of temp_a to temp_b
 - Special case int sized min values
 - More tests!
2014-09-24 22:01:09 +01:00
Leigh
3e9a31748d Make sure min < max 2014-09-24 07:56:46 +01:00
Leigh
31e27fc89a Add test files 2014-09-23 22:54:40 +01:00
Nikita Popov
00805ffb92 Merge branch 'PHP-5.6'
Conflicts:
	ext/soap/php_http.c
2014-09-04 21:23:11 +02:00
Nikita Popov
03797a73b2 Split GMP tests testing multiple functions
Also drop dummy test
2014-09-04 21:18:37 +02:00
Nikita Popov
9586b15229 Give proper names to GMP test files 2014-09-04 21:10:41 +02:00
Nikita Popov
15c139b99a Throw warnings when using zero modulus in gmp_powm
Also fixes a leak in this case.
2014-09-04 20:55:09 +02:00
Nikita Popov
f10d194c8c Add GMP tests for some uncovered branches 2014-09-04 20:03:29 +02:00
Nikita Popov
2d364747ca Merge branch 'PHP-5.6'
Conflicts:
	ext/gmp/gmp.c
2014-09-02 19:07:54 +02:00
Nikita Popov
834daa455b Fixed bug #50175
0x and 0b prefix is now only handled if either no base is given
or if the base is 16 (0x) or 2 (0b). Always handling it is incorrect
because 0x and 0b are perfectly valid numbers in other bases.
2014-09-02 19:04:55 +02:00
Nikita Popov
5138f3ba22 Skip 64bit test on 32bit
Also minor type improvements
2014-09-02 18:42:39 +02:00
Anatol Belski
e7386aa1fd add a test with gmp and PHP_INT_MAX 2014-09-02 18:16:19 +02:00
Leigh
47d630e7f0 Implement gmp_import() and gmp_export() 2014-09-02 14:19:18 +02:00
Nikita Popov
5e93a213f6 Add SKIPIF in GMP test 2014-03-12 14:17:08 +01:00
Nikita Popov
a117e6b937 Add tests for bug #66872 and gmp_[rem]root 2014-03-11 14:06:12 +01:00
datibbaw
aff56f3c45 add T_POW (**) operator
Fixed recognition of the operator

Added opcode, still doing multiply instead of pow()

opcode now always returns int(42)

The right answer, but always a float

Yanked code from pow() implementation.

Should not handle negative long as exponent ourselves

Added test cases from pow()

Moved precedence higher than '~'

Added GMP operator overloading

Added ZEND_ASSIGN_POW (**=) operator.

Added pow() as a language construct.

Adjusted test cases for changed precedence.

Reduced pow() to shell function around ZEND_API pow_function()

Reduced test case to only contain edge cases
Added overloading test case

Moved unary minus above T_POW

Revert "Added pow() as a language construct."

Bad bad bad idea.

This reverts commit f60b98cf7a8371233d800a6faa286ddba4432d02.

Reverted unary minus behaviour due to previous revert.
Convert arrays to int(0)
Exponent with array as a base becomes int(0)

Rebase against master

Fixed tokenizer test case
2014-02-06 14:41:21 +01:00
Nikita Popov
5408f1e5a6 Throw warning when converting invalid string to GMP 2013-12-30 14:38:09 +01:00
Nikita Popov
4218e89f8d Fix bug #65997 by switching to Serializable for GMP
Rather than using get_properties and __wakeup for serialization
the code now uses Serializable::serialize() and
Serializable::unserialize(). The get_properties handler is switched
to a get_debug_info handler. Thus get_gc will now return only
the normal properties and not do any modifications, thus fixing
the leak. This also avoids a $num property from being publicly
visible after the object was dumped or serialized, so that's an
extra plus.
2013-10-29 20:58:30 +01:00
Nikita Popov
7713b8c2ac GMP improvements
As per RFC https://wiki.php.net/rfc/operator_overloading_gmp
2013-06-17 17:59:12 +02:00
Anatoliy Belsky
9a72b52a1f fixing test for upcoming mpir upgrade
- mpir is going to be upgraded up to 2.5.1 on windows
2012-08-23 17:09:45 +02:00
Matt Ficken
645d65f3e3 Fixed bug #62068 Test bug - gmp_nextprime and 022 2012-05-21 12:31:16 +02:00
Stanislav Malyshev
b55d4ecb41 Fix bug #52906 gmp_mod returns negative result when non-negative is expected 2010-10-01 00:12:23 +00:00
David Soria Parra
99c43e1b93 Also allow base 62 for gmp_init as requested in (#50283) 2009-11-25 23:38:34 +00:00
David Soria Parra
579a6e39de Really use 62 as the upper boundary as requested and not 32. 2009-11-25 18:15:25 +00:00
David Soria Parra
18f32db810 Implement feature request #50283 (allow base in gmp_strval to use full range: 2 to 62, and -2 to -36) 2009-11-24 13:33:35 +00:00
Nuno Lopes
b2e6a56e5c fix tests 2007-12-27 16:05:00 +00:00
Stanislav Malyshev
7c69bbaec7 add tests for testbit, sync with HEAD 2007-11-01 18:43:34 +00:00
Stanislav Malyshev
d0fffa7a72 generalize resource names 2007-11-01 17:52:20 +00:00
Antony Dovgal
bdcefbdc5d fix 64bit issues & tests 2007-11-01 09:25:11 +00:00
Stanislav Malyshev
eb5bd09cff - Fix memory leaks (bug #42509)
- Fix _gmp_binary_opl
- Use modern parameter parsing
2007-11-01 00:46:13 +00:00
Antony Dovgal
7e1647e524 MFH: add missing skipif sections 2007-05-27 15:12:33 +00:00
Antony Dovgal
1f65545121 fix test names 2007-05-07 18:03:01 +00:00
Antony Dovgal
9fd3c30f94 MFH 2007-05-04 22:32:57 +00:00
Antony Dovgal
a6cd2b4cec MFH: improve the tests 2007-04-27 11:43:45 +00:00
Antony Dovgal
3e7b4e5d1a MFH: add test & GMP_VERSION constant
do not allow zero operand in gmp_divexact()
2007-04-26 13:44:02 +00:00
Antony Dovgal
6a0efe0b7d new tests for ext/gmp 2007-04-18 21:04:21 +00:00
Antony Dovgal
334c36ac7c new tests 2006-09-10 22:11:29 +00:00
Antony Dovgal
9e905c3de7 MFH: add gmp_nextprime()
patch by ants dot aasma at gmail dot com
2006-07-18 14:54:32 +00:00
foobar
c24bd1584c fix test - short_tags not allowed here! 2005-06-17 16:22:55 +00:00
Stanislav Malyshev
b86bab9735 @- Fix #32773 and make right fix for GMP FPEs (Stas)
Fix #32773 and make right fix for GMP FPEs
2005-04-25 12:18:50 +00:00
Marcus Boerger
29cfd6d24f - Remove unused blocks 2004-05-19 08:56:50 +00:00
foobar
f4983c0d3f - Renamed all *php4* files to *php5*, changed all php4/PHP4 to php5/PHP5 2004-01-17 13:00:38 +00:00
Sander Roobol
58a52f93bc Fixed many tests, mostly incorrect paths. 2002-03-08 19:16:19 +00:00
Sean Bright
72c5a9cd8a Add a new test for GMP base recognition. 2002-02-10 23:13:37 +00:00
Sascha Schumann
60492fa685 Skip mcrypt/gmp tests, if the extensions are not available. 2000-12-24 16:51:04 +00:00
Stanislav Malyshev
e81c9642b8 Add GMP tests 2000-12-13 15:55:40 +00:00