The APIs are flexible and easytouse, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning. Learn more →
Brick\Math Alternatives
Similar projects and alternatives to Brick\Math


decimalobject
Decimal handling as value object instead of plain strings.

LearnThisRepo.com
Learn 300+ open source libraries for free using AI. LearnThisRepo lets you learn 300+ open source repos including Postgres, Langchain, VS Code, and more by chatting with them using AI!




ip
Immutable value object for IPv4 and IPv6 addresses, including helper methods and Doctrine support. (by darsyn)

Fermat
A library providing math and statistics operations for numbers of arbitrary size.

InfluxDB
Power RealTime Data Analytics at Scale. Get realtime insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in realtime with unbounded cardinality.

break_infinity.js
A replacement for decimal.js for incremental games who want to deal with very large numbers (bigger in magnitude than 1e308, up to as much as 1e(9e15) ) and want to prioritize speed over accuracy.


PHP Units of Measure
A library for handling physical quantities and the units of measure in which they're represented.

figstandards
Standards either proposed or approved by the Framework Interop Group

PHPStan
PHP Static Analysis Tool  discover bugs in your code without running it!



big.js
A small, fast JavaScript library for arbitraryprecision decimal arithmetic.



PHP Mess Detector
PHPMD is a spinoff project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD. PHPMD can be seen as an user friendly frontend application for the raw metrics stream measured by PHP Depend.

Safe
All PHP functions, rewritten to throw exceptions instead of returning false

SensioLabs Security Check
A database of PHP security advisories

WorkOS
The modern API for authentication & user identity. The APIs are flexible and easytouse, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Brick\Math reviews and mentions

PHP libraries and tools
brick/math: Arbitraryprecision arithmetic library for PHP

PHP is trolling me
Use strings. For PHP specifically, the Brick/Math library.

Need Guidance for my Passionate Ecommerce Project
https://github.com/brick/math to handle bignumber and operations

How are you handling your money?
In Java and Ruby, BigDecimal is an inbuilt class that can be used. For PHP, you can checkout the Brick Math Library Basically, just find the arbitraryprecision Decimal type/Class/Library in your choice of language. Got another approach, please do let me know in comment section.
 Weekly "ask anything" thread

What are the latest thoughts on storing and working with very large and very small financial transactions?
I decided to use https://github.com/brick/math and store the amount as a string in the database. My project use NANO, so that's 30 decimal points to keep. Number type column is not the choice at all.

Vote for enums in PHP 8.1 has started — looking good so far!
There are many use cases where enums don't need to be backed by a scalar. I'm thinking of brick/math's RoundingMode for example: you use these in code, but never store/serialize them really.

(int) (round(19.33, 2) * 100) = 1932  can someone please explain this to me?
Besides, using an arbitraryprecision library gives you an unlimited number of digits, and, in the case of brick/math, many more rounding modes to choose from. And predictable ones.
TL;DR: don't use floats if you ever need to rely on rounding. Use an arbitraryprecision arithmetic library such as brick/math. Example:

A note from our sponsor  WorkOS
workos.com  21 Feb 2024
Stats
brick/math is an open source project licensed under MIT License which is an OSI approved license.
The primary programming language of Brick\Math is PHP.