# PaulRBerg/prb-math

Solidity library for advanced fixed-point math

Repository: https://github.com/PaulRBerg/prb-math
Canonical: https://ross.abutalabs.com/products/prb-math
Language: Solidity
License: MIT
License Family: permissive
Topics: library, ethereum, evm, math, smart-contracts, solidity, decentralized-finance, defi
Last push: 2026-08-14T16:33:52+00:00

## Health v2 (maintenance only)
Score: 89/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 97, release rhythm 72, longevity 100
- inputs: {"age_days": 1988, "days_push": 19, "days_rel": 30, "gap_med": 108, "n_releases_24m": 4}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1006, forks 145 (observed 2026-08-28T04:03:11.904087+00:00)

## What it is
PRBMath is a Solidity library for advanced fixed-point arithmetic using signed SD59x18 and unsigned UD60x18 number formats with 18 decimals. It provides gas-efficient, type-safe math functions like logarithms, exponentials, powers, square roots, and overflow-safe mulDiv for smart contract development.

## Use cases
- perform fixed-point math in solidity smart contracts
- compute logarithms and exponentials on-chain
- implement defi pricing and interest calculations
- safe multiplication and division without overflow in solidity
- type-safe decimal arithmetic for evm contracts

## When to choose
- you need precise decimal math in solidity with 18-decimal fixed-point numbers
- you want type safety via user-defined value types
- you need gas-efficient advanced math functions like exp, ln, and sqrt on-chain

## When to avoid
- you only need simple integer arithmetic
- you prefer binary fixed-point formats like ABDKMath64x64
- you are not developing for the EVM

## Facets
- artifact type: library
- maturity: stable
- function: math, sdk
- domain: blockchain, fintech, developer-tools
- platform: -
- tags: solidity, smart-contracts, fixed-point, defi, evm, foundry, ethereum

## Member repositories
- PaulRBerg/prb-math (main) score 89

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:11.904087+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:12:44.427346+00:00, confidence not recorded.
  - readme: https://github.com/PaulRBerg/prb-math (fetched 2026-08-28T04:03:11.904087+00:00, sha 8fda286315e4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
