summaryrefslogtreecommitdiff
path: root/ext/bcmath
Commit message (Collapse)AuthorAgeFilesLines
...
| | | * Fix remaining AppVeyor test failures due to the image updateAnatol Belski2018-05-194-2/+22
| | | |
| | | * year++Xinchen Hui2018-01-022-2/+2
| | | |
| | * | year++Xinchen Hui2018-01-022-2/+2
| | | |
| * | | Future-proof email addressesZeev Suraski2018-11-012-2/+2
| | | |
| * | | Sync leading and final newlines in *.phpt sectionsPeter Kokot2018-10-1514-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines in all *.phpt sections. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
| * | | Sync leading and final newlines in source code filesPeter Kokot2018-10-1419-22/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
| * | | Trim trailing whitespace in source code filesPeter Kokot2018-10-131-1/+1
| | | |
* | | | Add AS_HELP_STRING to *nix build configure optionsPeter Kokot2019-03-071-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Autoconf's default AS_HELP_STRING macro can properly format help strings [1] so watching out if columns are aligned manually is not anymore. [1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
* | | | Remove tests for zpp failure conditionsNikita Popov2019-03-0510-125/+0
| | | | | | | | | | | | | | | | | | | | These tests only check zpp error conditions, so drop them per zpp testing policy.
* | | | Remove local variablesPeter Kokot2019-02-031-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the so called local variables defined per file basis for certain editors to properly show tab width, and similar settings. These are mainly used by Vim and Emacs editors yet with recent changes the once working definitions don't work anymore in Vim without custom plugins or additional configuration. Neither are these settings synced across the PHP code base. A simpler and better approach is EditorConfig and fixing code using some code style fixing tools in the future instead. This patch also removes the so called modelines for Vim. Modelines allow Vim editor specifically to set some editor configuration such as syntax highlighting, indentation style and tab width to be set in the first line or the last 5 lines per file basis. Since the php test files have syntax highlighting already set in most editors properly and EditorConfig takes care of the indentation settings, this patch removes these as well for the Vim 6.0 and newer versions. With the removal of local variables for certain editors such as Emacs and Vim, the footer is also probably not needed anymore when creating extensions using ext_skel.php script. Additionally, Vim modelines for setting php syntax and some editor settings has been removed from some *.phpt files. All these are mostly not relevant for phpt files neither work properly in the middle of the file.
* | | | Remove yearly range from copyright noticeZeev Suraski2019-01-302-2/+2
| | | |
* | | | Clean up unnecessary ternary expressions and simplify some returnsGabriel Caruso2018-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Simplify conditions - Use ZEND_HASH_APPLY_* instead of hard-coded booleans - Use ZEND_NORMALIZE_BOOL - Drop sign in favor of ZEND_NORMALIZE_BOOL
* | | | Future-proof email addresses...Zeev Suraski2018-11-012-2/+2
| | | |
* | | | Sync leading and final newlines in *.phpt sectionsPeter Kokot2018-10-1514-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines in all *.phpt sections. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
* | | | Sync leading and final newlines in source code filesPeter Kokot2018-10-1419-22/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
* | | | Trim trailing whitespace in source code filesPeter Kokot2018-10-131-1/+1
| | | |
* | | | Remove HAVE_ASSERT_HPeter Kokot2018-09-0921-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `<assert.h>` header file is part of the standard C89 headers [1] and on older systems there needed to be also a manual check if header is present. Since PHP requires at least C89 manual check and the `HAVE_ASSERT_H` symbol defined by Autoconf in configure.ac can be both removed [2]. This patch also removes unused <assert.h> includes where c files don't use the `assert()` macro. Refs: [1] https://port70.net/~nsz/c/c89/c89-draft.html#4.2 [2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
* | | | Fix some misspellingsGabriel Caruso2018-08-121-1/+1
|/ / /
* | | 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.