Added BcMath\Number class. It is an immutable object, has methods that are
equivalent to existing BCMath calculation functions, and can also be calculated
using operators.
The existing BCMath function returned a string for each calculation, but this
class returns an object.
RFC: https://wiki.php.net/rfc/support_object_type_in_bcmath,
https://wiki.php.net/rfc/fix_up_bcmath_number_class
---------
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
* ext/bcmath: coding style: use indentation
And add braces to block statements, as the current code was pretty much unreadable with how inconsistent it was.
* ext/bcmath: Remove some useless header inclusions
* ext/bcmath: Use standard C99 bool type instead of char
* ext/bcmath: Include specific headers instead of config.h
* Restructure definitions to reduce header inclusions
* Use size_t as a more appropriate type
* Remove unused variable full_scale
* Refactor bc_raisemod() to get rid of Zend dependencies
This separates the concerns of throwing exceptions back into the PHP_FUNCTION instead of being the responsibility of the library
* Refactor bc_raise() to get rid of Zend dependencies
This separates the concerns of throwing exceptions back into the PHP_FUNCTION instead of being the responsibility of the library
* Refactor bc_divmod() and bc_modulo() to return bool
Return false on division by 0 attempt instead of -1 and true on success instead of 0
* Refactor bc_divide() to return bool
Return false on division by 0 attempt instead of -1 and true on success instead of 0
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
Make sure bcmatch scale is between 0 and INT_MAX, both for the
ini setting, and all the functions accepting a scale argument.
A ValueError is thrown if a function argument is out of range.
Closes GH-5455.
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.