Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
E

ext-decimal

> DevOps
Open source

Correctly-rounded, arbitrary precision decimal floating-point arithmetic in PHP

344 stars0 likes0 views
WebsiteGitHub

About

Correctly-rounded, arbitrary precision decimal floating-point arithmetic in 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 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHParbitrary-precisiondecimalphp

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
CategoryDevOps
PricingOpen source

> Related tools

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