百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
E

ext-decimal

> DevOps
开源

PHP 中正确的四舍五入、任意精度的小数浮点运算

344 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

PHP 中正确的四舍五入、任意精度的小数浮点运算

PHP Decimal Extension

Correctly-rounded, arbitrary-precision decimal arithmetic for PHP

Documentation

See php-decimal.github.io

Requirements

  • PHP >= 7.2
  • libmpdec >= 2.4

Installing libmpdec header files

For Fedora:

bash
sudo dnf install mpdecimal-devel

Install

pecl install decimal

Alpha:

pecl install decimal-alpha

Windows users can find .dll files under 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, you can use phpbrew ext enable decimal.

Tests

php run-tests.php -P -q

Build from source

Build a debug build of php-src with a prefix as follows:

bash
./configure --disable-all --enable-debug --prefix /path/to/custom-php/

Within the folder of this extension first run phpize and then

bash
./configure --with-php-config=/path/to/custom-php/bin/php-config CFLAGS="-Wfatal-errors -Wall -Wpedantic -Wextra -Wno-unused-parameter -Werror"

And finally:

bash
make -jN

Where N is the number of cores available for compilation

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHParbitrary-precisiondecimalphp

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理