summaryrefslogtreecommitdiff
path: root/ext/bcmath
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused Git attributes identPeter Kokot2018-07-254-8/+1
| | | | | | | | | | | | | | | The $Id$ keywords were used in Subversion where they can be substituted with filename, last revision number change, last changed date, and last user who changed it. In Git this functionality is different and can be done with Git attribute ident. These need to be defined manually for each file in the .gitattributes file and are afterwards replaced with 40-character hexadecimal blob object name which is based only on the particular file contents. This patch simplifies handling of $Id$ keywords by removing them since they are not used anymore.
* Remove build system files of bundled library libbcmathPeter Kokot2018-05-2911-2505/+0
| | | | | The bundled library libbcmath is maintained in the php-src and its build system files are outdated and not used.
* Use EXPECT instead of EXPECTF when possibleGabriel Caruso2018-02-208-8/+8
| | | | EXPECTF logic in run-tests.php is considerable, so let's avoid it.
* Add test for bcpwmodGabriel Caruso2018-02-121-0/+10
| | | | bc_raisemod's mod can't be zero and expo can't be negative
* year++Xinchen Hui2018-01-022-2/+2
|
* Move constants into read-only data segmentDmitry Stogov2017-12-141-1/+1
|
* Don't reintroduce split_bc_num()Christoph M. Becker2017-11-071-20/+1
| | | | | | | | | | This function has been removed in 870ed5106d6274905b5aa4341429deef12c92e55, because it is not necessary to manipulate the `bc_num` itself; instead we simply omit extraneous decimals when converting the number to string. This resolves the issue introduced by 24fd49fbabc7c5ad941095f33d05fe2e41ff667d in a cleaner way than 121d193514cbf59450a7dee0ad2e883101cbe9dd.
* Fixed build (missing function borrowed from PHP-7.2)Dmitry Stogov2017-11-071-0/+15
|
* Merge branch 'PHP-7.2'Sara Golemon2017-11-063-8/+21
|\ | | | | | | | | * PHP-7.2: Scale support for bcmod()
| * Scale support for bcmod()Christoph M. Becker2017-11-063-8/+21
| | | | | | | | | | | | | | | | | | | | | | As of commit 90dcbbe (PHP-7.2+) bcmod() supports non-integral parameters as well. Since formerly only integer modulus has been supported, it did not make much sense to cater to the scale with regard to the result. However, now it does for consistency with other BCMath operations. Therefore, we add support for an optional `scale` parameter and fall back to the default scale (`bcmath.scale`) as usual.
* | Merge branch 'pull-request/2742'Christoph M. Becker2017-09-189-63/+90
|\ \ | | | | | | | | | | | | * pull-request/2742: Fixed bug #66364 (BCMath bcmul ignores scale parameter)
| * | Fixed bug #66364 (BCMath bcmul ignores scale parameter)Christoph M. Becker2017-09-087-61/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We change `bcmul()` and `bcpow()` so that the result has exactly the requested scale (i.e. decimal places) to make them consistent with the other BCMath functions. This also changes our stance regarding bug #52748, which had been classified as documentation problem. We do not manipulate the numbers themselves (anymore), but rather introduce `bc_num2str_ex()` which accepts a scale parameter that overrides the scale of the number by omitting extraneous decimals and adding zeros, respectively. This also allows us to get rid of `split_bc_num()`, which fixes bug #75164 as well.
* | | Merge branch 'pull-request/2745'Christoph M. Becker2017-09-1312-123/+43
|\ \ \ | | | | | | | | | | | | | | | | * pull-request/2745: Fixed bug #75169 (BCMath errors/warnings bypass error handling)
| * | | Fixed bug #75169 (BCMath errors/warnings bypass error handling)Christoph M. Becker2017-09-0912-123/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of writing warning messages to `stderr`, we employ PHP's error handling to raise `E_WARNING` even for the single case where `bc_rt_error()` has been called, since that did not actually error out. We choose to call `php_error_docref()` directly in libbcmath, since there is no upstream, and since other PHP core functionality is already used in our bundled libbcmath. Accordingly, we remove `rt.c` so it will not be accidentally used in the future. Besides adapting a few existing tests, we add new tests so that the warnings are tested at least once. We also get rid of the Windows specific tests, since the warning behavior is now supposed to be platform-agnostic.
* | | | Merge branch 'pull-request/2739'Christoph M. Becker2017-09-132-6/+29
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * pull-request/2739: Fix proto and indentation Fix arginfo Return old scale value from bcscale()
| * | | | Fix proto and indentationChristoph M. Becker2017-09-061-2/+2
| | | | |
| * | | | Fix arginfoChristoph M. Becker2017-09-061-1/+1
| | | | | | | | | | | | | | | | | | | | The `scale` parameter is now optional.
| * | | | Merge branch 'pull-request/778' into bcscale-return-old-valueChristoph M. Becker2017-09-062-3/+26
| |\ \ \ \
| | * | | | Return old scale value from bcscale()Chris Wright2014-08-182-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | Fix for #67855
* | | | | | Merge branch 'PHP-7.2'Christoph M. Becker2017-09-112-0/+19
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | / | | |_|_|/ | |/| | | * PHP-7.2: Fixed bug #46781 (BC math handles minus zero incorrectly)
| * | | | Merge branch 'PHP-7.1' into PHP-7.2Christoph M. Becker2017-09-112-0/+19
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.1: Fixed bug #46781 (BC math handles minus zero incorrectly)
| | * \ \ \ Merge branch 'PHP-7.0' into PHP-7.1Christoph M. Becker2017-09-112-0/+19
| | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.0: Fixed bug #46781 (BC math handles minus zero incorrectly)
| | | * | | | Fixed bug #46781 (BC math handles minus zero incorrectly)Christoph M. Becker2017-09-112-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Actually, there is no negative zero at all. We obey Postel's law, and still accept negative zeroes, but we store them as positive zeroes after the conversion from string, i.e. we normalize before further processing.
* | | | | | | Optimize truncation to zero scale in bc_raisemod()Christoph M. Becker2017-09-091-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no need to use a division by one to truncate to zero scale; instead we introduce and use `_bc_truncate()`, what is more efficient.
* | | | | | | Merge branch 'PHP-7.2'Christoph M. Becker2017-09-092-0/+24
|\ \ \ \ \ \ \ | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | * PHP-7.2: Fix bug75178.phpt on Windows
| * | | | | | Merge branch 'PHP-7.1' into PHP-7.2Christoph M. Becker2017-09-092-0/+24
| |\ \ \ \ \ \ | | |/ / / / / | | | | | | | | | | | | | | | | | | | | | * PHP-7.1: Fix bug75178.phpt on Windows
| | * | | | | Merge branch 'PHP-7.0' into PHP-7.1Christoph M. Becker2017-09-092-0/+24
| | |\ \ \ \ \ | | | |/ / / / | | | | | | | | | | | | | | | | | | | | | * PHP-7.0: Fix bug75178.phpt on Windows
| | | * | | | Fix bug75178.phpt on WindowsChristoph M. Becker2017-09-092-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bug75178.phpt fails on Windows, because the stderr output is not interspersed with stdout output there, but rather is appended to the end. The fix is analogous to bug72093.phpt.
* | | | | | | Merge branch 'PHP-7.2'Christoph M. Becker2017-09-092-7/+33
|\ \ \ \ \ \ \ | |/ / / / / / | | | | | | / | |_|_|_|_|/ |/| | | | | * PHP-7.2: Fixed bug #75178 (bcpowmod() misbehaves for non-integer base or modulus)
| * | | | | Merge branch 'PHP-7.1' into PHP-7.2Christoph M. Becker2017-09-092-7/+33
| |\ \ \ \ \ | | |/ / / / | | | | | | | | | | | | | | | | | | * PHP-7.1: Fixed bug #75178 (bcpowmod() misbehaves for non-integer base or modulus)
| | * | | | Merge branch 'PHP-7.0' into PHP-7.1Christoph M. Becker2017-09-092-7/+33
| | |\ \ \ \ | | | |/ / / | | | | | | | | | | | | | | | | | | * PHP-7.0: Fixed bug #75178 (bcpowmod() misbehaves for non-integer base or modulus)
| | | * | | Fixed bug #75178 (bcpowmod() misbehaves for non-integer base or modulus)Christoph M. Becker2017-09-092-7/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since `bcpowmod()` does not support non-integral operands, we have to truncate these in addition to emitting a respective warning. We also have to work with the truncated values in the following. We recognize that the division by one to enforce the truncation is actually overkill, but we stick with it for now, and shall tackle the issue for PHP 7.3.
* | | | | | Remove unused memberChristoph M. Becker2017-09-082-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `n_next` member of struct `bc_struct` is unused; the only code that would use this member has been disabled since libbcmath has been bundled nearly 17 years ago. Apparently, `n_next` has been designed to build a linked list of free numbers, but it is doubtful whether that would be an improvement over relying on the efficiency of the ZendMM, so we remove the remaining support altogether. The ABI break probably affects nobody, but would be okay for a new minor version according to our release process, anyway.
* | | | | | Merge branch 'PHP-7.2'Christoph M. Becker2017-09-072-8/+31
|\ \ \ \ \ \ | |/ / / / / | | | | | | | | | | | | | | | | | | * PHP-7.2: Fixed bug #54598 (bcpowmod() may return 1 if modulus is 1)
| * | | | | Merge branch 'PHP-7.1' into PHP-7.2Christoph M. Becker2017-09-072-8/+31
| |\ \ \ \ \ | | |/ / / / | | | | | | | | | | | | | | | | | | * PHP-7.1: Fixed bug #54598 (bcpowmod() may return 1 if modulus is 1)
| | * | | | Merge branch 'PHP-7.0' into PHP-7.1Christoph M. Becker2017-09-072-8/+31
| | |\ \ \ \ | | | |/ / / | | | | | | | | | | | | | | | | | | * PHP-7.0: Fixed bug #54598 (bcpowmod() may return 1 if modulus is 1)
| | | * | | Fixed bug #54598 (bcpowmod() may return 1 if modulus is 1)Christoph M. Becker2017-09-072-8/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `x mod 1` is always zero; we have to take the scale into account, though.
* | | | | | Merge branch 'PHP-7.2'Christoph M. Becker2017-09-062-1/+17
|\ \ \ \ \ \ | |/ / / / / | | | | / / | |_|_|/ / |/| | | | * PHP-7.2: Fixed bug #44995 (bcpowmod() fails if scale != 0)
| * | | | Merge branch 'PHP-7.1' into PHP-7.2Christoph M. Becker2017-09-062-1/+17
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | * PHP-7.1: Fixed bug #44995 (bcpowmod() fails if scale != 0)
| | * | | Merge branch 'PHP-7.0' into PHP-7.1Christoph M. Becker2017-09-062-1/+17
| | |\ \ \ | | | |/ / | | | | | | | | | | | | | | | * PHP-7.0: Fixed bug #44995 (bcpowmod() fails if scale != 0)
| | | * | Fixed bug #44995 (bcpowmod() fails if scale != 0)Christoph M. Becker2017-09-062-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | `bc_divmod()` is supposed to do integer division, so we must not apply a scale factor here.
* | | | | Get rid of all these old package[2].xml files, most of these had no had a ↵Kalle Sommer Nielsen2017-08-171-94/+0
|/ / / / | | | | | | | | | | | | | | | | | | | | release since PHP4, or any release at all in close to 10 years, some even did not have a package registered at pecl OCI, PDO_OCI and zip are left as they are actively developed and released there
* | | | Merge branch 'PHP-7.1'Xinchen Hui2017-04-101-1/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.1: Fixed condition check Fixed condition check another place Conflicts: ext/mcrypt/mcrypt.c
| * | | Merge branch 'PHP-7.0' into PHP-7.1Xinchen Hui2017-04-101-1/+1
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.0: Fixed condition check
| | * | Fixed condition checkXinchen Hui2017-04-101-1/+1
| | | |
| | * | Update copyright headers to 2017Sammy Kaye Powers2017-01-042-2/+2
| | | |
| * | | Update copyright headers to 2017Sammy Kaye Powers2017-01-042-2/+2
| | | |
* | | | Increased bcmath functions coverage tests using scale option parameterEdgar R. Sandi2017-03-274-0/+8
| | | |
* | | | Remove dead code from BCMath extensionThomas Punt2017-03-163-21/+2
| | | |
* | | | Drop unnecessary allocator return value checksNikita Popov2017-03-133-6/+0
| | | |