https://github.com/php-decimal/extension
Correctly-rounded, arbitrary precision decimal floating-point arithmetic in PHP
https://github.com/php-decimal/extension
arbitrary-precision decimal php
Last synced: 4 months ago
JSON representation
Correctly-rounded, arbitrary precision decimal floating-point arithmetic in PHP
- Host: GitHub
- URL: https://github.com/php-decimal/extension
- Owner: php-decimal
- License: mit
- Created: 2018-10-13T15:46:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-05T06:31:46.000Z (about 1 year ago)
- Last Synced: 2024-12-02T02:05:07.873Z (5 months ago)
- Topics: arbitrary-precision, decimal, php
- Language: PHP
- Homepage: https://php-decimal.github.io/
- Size: 357 KB
- Stars: 339
- Watchers: 16
- Forks: 19
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-php-extensions - php-decimal - 提供对 decimal 的支持。官方提供纯 php 版 (数据转换)
- favorite-link - PHP 7 中的正确舍入,任意精度的十进制浮点运算。
README
# PHP Decimal Extension
[](https://pecl.php.net/package/decimal/1.3.1)
[](https://travis-ci.org/php-decimal/ext-decimal)[](https://pecl.php.net/package/decimal/2.0.0)
[](https://travis-ci.org/php-decimal/ext-decimal)
[](https://ci.appveyor.com/project/rtheunissen/php-decimal)Correctly-rounded, arbitrary-precision decimal arithmetic for PHP
## Documentation
See [php-decimal.github.io](https://php-decimal.github.io)
## Requirements
- PHP >= 7.2
- [libmpdec >= 2.4](http://www.bytereef.org/mpdecimal/download.html)## Install
```
pecl install decimal
```**Alpha**:
```
pecl install decimal-alpha
```Windows users can find *.dll* files under [releases](https://github.com/php-decimal/ext-decimal/releases).
## Enable
You can do this temporarily using `php -dextension=decimal.so` or by adding `extension=decimal.so` to your INI. If you manage PHP with [phpbrew](https://github.com/phpbrew/phpbrew), you can use `phpbrew ext enable decimal`.
## Tests
```
php run-tests.php -P -q
```