awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
shopspring avatar

shopspring/decimal

0
View on GitHub↗
7,242 stars·652 forks·Go·other·18 views

Decimal

This is an arbitrary-precision decimal library and fixed-point math implementation used to eliminate floating-point rounding errors. It provides tools for high-precision arithmetic, a numerical analysis toolkit, and a database decimal mapper to ensure numerical accuracy in financial and scientific calculations.

The library includes specialized serialization tools to transform high-precision numbers into SQL database types, JSON, and XML formats without losing precision. It also implements a variety of rounding strategies, including banker and cash rounding, and provides mechanisms for decimal truncation and exponent shifting.

The project covers a broad range of mathematical capabilities, including basic arithmetic, division with remainders, and statistical aggregation. It further supports advanced functions such as natural logarithms, exponents, power and root calculations, and trigonometric functions.

Conversion utilities are provided to create decimal values from strings, integers, floating-point numbers, big integers, and rational numbers.

Features

  • Arbitrary Precision Arithmetic - Provides a computational engine using integer-based math to eliminate floating-point errors in financial and scientific calculations.
  • Numerical Rounding - Implements diverse rounding strategies including banker's rounding, cash rounding, and rounding toward zero.
  • Database Type Mappings - Maps application decimal types to native database formats using standard scanner and valuer interfaces.
  • Database Row Mappers - Maps arbitrary-precision decimal values to SQL database types using scanner and valuer patterns.
  • Fixed-Point Arithmetic Libraries - Implements addition and subtraction on arbitrary precision numbers using fixed-point arithmetic.
  • Fixed-Point Representations - Stores numbers as large integers paired with a scale factor to avoid binary floating-point precision errors.
  • Financial Arithmetic Libraries - Performs high-precision arithmetic on currency and monetary values to prevent floating-point rounding errors.
  • Natural Logarithms - Provides high-precision computation of natural logarithms to a user-specified number of decimal places.
  • JSON and Serialization - Transforms high-precision numbers into JSON and XML exchange formats without losing numerical accuracy.
  • Numeric JSON Serialization - Ensures high-precision decimals are consistently serialized to SQL and JSON formats during transmission.
  • Data Serialization Formats - Serializes high-precision decimals to and from JSON, XML, and binary formats without losing precision.
  • Decimal Type Conversion - Creates high-precision decimal values from strings, integers, floating-point numbers, and rational types.
  • Decimal String Formatting - Converts decimal numbers into rounded strings using standard, banker, or cash formats for consistent display.
  • Decimal Truncation - The project removes fractional digits from a number without rounding to reach a specified precision limit.
  • Exponent Shifting Utilities - Allows moving the decimal point left or right by modifying the internal exponent of the value.
  • Exponential Functions - Implements the calculation of natural exponents using algorithms tailored for high-precision decimal results.
  • Scientific Computing - Computes high-precision natural logarithms and trigonometric values for scientific software.
  • Exponent Scaling - Implements an internal scaling mechanism that adjusts numeric magnitude by shifting the scale factor rather than modifying the coefficient.
  • Precision Arithmetic - Executes complex mathematical functions and power operations with a configurable number of decimal places.
  • Euclidean Division Utilities - Allows for the division of two decimals to return both the quotient and the remainder.
  • Trigonometric Functions - Implements standard trigonometric functions including sine, cosine, tangent, and arctangent for decimal values.
  • Numerical Analysis Toolkits - Provides a toolkit for computing natural logarithms, exponents, and trigonometric values with configurable precision.
  • Power Functions - Provides high-precision power functions for raising decimal values to specified exponents.
  • Financial Tools - Arbitrary-precision fixed-point decimal numbers.
  • Mathematical Computing - Arbitrary-precision fixed-point decimal library.
  • Financial Libraries - Arbitrary-precision decimal numbers.

Star history

Star history chart for shopspring/decimalStar history chart for shopspring/decimal

How this analysis was created: This summary and feature list were written by an AI model that read the project's README and public documentation pages. Each feature links to the documentation it came from; stars, license and language come straight from the GitHub API. The model does not read the source code, and the analysis is refreshed when the project is re-analysed. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to Decimal

Similar open-source projects, ranked by how many features they share with Decimal.
  • mikemcl/big.jsMikeMcl avatar

    MikeMcl/big.js

    5,186View on GitHub↗

    big.js is an arbitrary-precision decimal library for JavaScript designed to perform exact decimal arithmetic. It provides a set of tools for high-precision addition, subtraction, multiplication, and division to avoid the rounding errors common in binary floating-point representations. The library allows for the creation of custom number constructors to isolate precision settings and rounding rules for different groups of numbers. It supports configurable global precision and specific rounding behaviors, such as truncate or round half even, for division and power operations. The capability su

    JavaScript
    View on GitHub↗5,186
  • stdlib-js/stdlibstdlib-js avatar

    stdlib-js/stdlib

    5,735View on GitHub↗
    JavaScriptjavascriptjslibrary
    View on GitHub↗5,735
  • leekchan/accountingleekchan avatar

    leekchan/accounting

    911View on GitHub↗

    money and currency formatting for golang

    Go
    View on GitHub↗911
  • g-truc/glmg-truc avatar

    g-truc/glm

    10,710View on GitHub↗

    This project is a header-only C++ library designed for graphics mathematics, providing a comprehensive suite of vector, matrix, and quaternion types. It is built using template metaprogramming to generate mathematical primitives at compile time, eliminating the need for precompiled binary libraries and allowing for direct integration into existing build systems. The library is distinguished by its strict adherence to the OpenGL Shading Language specification, ensuring that mathematical results remain consistent across both CPU and GPU code. It provides specialized utilities for managing float

    C++cppcpp-libraryglm
    View on GitHub↗10,710
See all 30 alternatives to Decimal→

Frequently asked questions

What does shopspring/decimal do?

This is an arbitrary-precision decimal library and fixed-point math implementation used to eliminate floating-point rounding errors. It provides tools for high-precision arithmetic, a numerical analysis toolkit, and a database decimal mapper to ensure numerical accuracy in financial and scientific calculations.

What are the main features of shopspring/decimal?

The main features of shopspring/decimal are: Arbitrary Precision Arithmetic, Numerical Rounding, Database Type Mappings, Database Row Mappers, Fixed-Point Arithmetic Libraries, Fixed-Point Representations, Financial Arithmetic Libraries, Natural Logarithms.

What are some open-source alternatives to shopspring/decimal?

Open-source alternatives to shopspring/decimal include: mikemcl/big.js — big.js is an arbitrary-precision decimal library for JavaScript designed to perform exact decimal arithmetic. It… stdlib-js/stdlib. leekchan/accounting — money and currency formatting for golang. g-truc/glm — This project is a header-only C++ library designed for graphics mathematics, providing a comprehensive suite of… nefe/number-precision — number-precision is a JavaScript math library and arbitrary precision arithmetic utility. It provides a set of… mikemcl/bignumber.js — bignumber.js is an arbitrary-precision JavaScript library designed to perform mathematical operations on decimals and…