php-bignumbers
php-bignumbers copied to clipboard
A robust library to handle immutable big numbers inside PHP applications
This fix extends the handling of exponential notation for numbers like below, which throws an exception "strValue must be a number" before: 100000e-8 1.33E+33 11111111e-7
When creating from a string value leading decimals cause a `NaNInputError`. ```php // Works \Litipk\BigNumbers\Decimal::fromString('0.110'); // PHP Fatal error: Uncaught Litipk\BigNumbers\Errors\NaNInputError: strValue must be a number \Litipk\BigNumbers\Decimal::fromString('.110'); ``` A simple...
This allows `Decimal` objects to be JSON serialized using `json_encode()`. They are serialized as their internal string representation since this is the most accurate. Using `json_encode($decimal, JSON_NUMERIC_CHECK)` results in the...
String conversion is locale aware, because its primary use case is for display purposes. This hack assumes that the only other decimal point is a comma, which gets replaced by...
When I run the `DecimalModTest::testFiniteFiniteMod()` test using the following data sets, I get failures: ### Data Provider ``` # Extant passing tests. ['10', '3', '1'], ['34', '3.4', '0'], ['15.1615', '3.156156',...
got this value `-2.689785E + 23` and i need convert it to absolute before work with him. When `abs` method is used, it returns` 0`. I was checking why and...
`public function arccos(int $scale = null): Decimal` $scale is null here by default, but used like (int) 0. This is working in the additions `$scale + 2` etc., but crashes...
Hello, I've experienced some strange behavior of `Decimal::fromFloat()` when lowering the scale using the second parameter. I've provided additional tests and fixed the behavior using `innerRound` so it's consistent with...
Suggestion for some code style changes to improve the overall code quality. #hacktoberfest
Please bring back php-exceptions repository. We're still using php5, so that means we use 0.7.3 version which has a dependancy on php-exceptions.