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
MikeMcl avatar

MikeMcl/decimal.js

0
View on GitHub↗
7,205 stars·491 forks·JavaScript·MIT·35 viewsmikemcl.github.io/decimal.js↗

Decimal.js

decimal.js is a JavaScript arbitrary precision library designed to perform mathematical calculations without the rounding errors associated with standard floating-point numbers. It provides a high-precision math toolkit for executing basic arithmetic and advanced transcendental functions with configurable significant digits.

The library implements decimal-based math that supports various rounding modes and arbitrary precision settings. It includes a numeric string parser for converting decimal, hexadecimal, binary, and octal strings into high-precision numeric types, as well as a utility for transforming high-precision decimal values into fractions with constrained denominators.

Capability areas cover basic arithmetic, high-precision value comparison, and advanced mathematical functions such as roots, exponents, logarithms, and trigonometry. The toolkit also provides numeric output formatting and secure random number generation using system entropy.

Features

  • JavaScript Math Libraries - Provides a comprehensive library for scientific and arbitrary precision mathematical calculations specifically for JavaScript environments.
  • Arbitrary Precision Arithmetic - Performs addition, subtraction, multiplication, and division on high-precision numbers using integer-based math to avoid floating-point errors.
  • Numeric Precision Management - Allows users to set global or instance-level rules for significant digits and rounding modes to control calculation precision.
  • Text-to-Numeric Parsing - Parses strings formatted in decimal, binary, hexadecimal, or octal notations into high-precision decimal instances.
  • String-to-Numeric Conversions - Converts numeric strings in decimal, binary, hexadecimal, and octal bases into high-precision numeric types.
  • Rounding Utilities - Rounds numeric values to specific significant digits or decimal places using various configurable rounding modes.
  • Calculation Precision Configurations - Provides global and instance-level controls for significant digits and rounding modes to manage calculation accuracy.
  • Decimal Arithmetic Types - Implements a decimal-based math system that avoids binary floating-point errors via arbitrary precision and rounding modes.
  • Exact Value Comparisons - Evaluates whether high-precision numbers are equal, greater than, or less than one another without rounding errors.
  • Scientific Computing Libraries - Executes complex mathematical functions like logarithms, roots, and trigonometry with configurable precision in JavaScript.
  • Large Integer Representations - Stores numbers as arrays of integers to bypass standard JavaScript floating-point precision limits.
  • Rounding Utilities - Implements multiple mathematical rounding modes such as floor and ceiling for high-precision values.
  • Transcendental Function Implementations - Computes roots, exponents, logarithms, and trigonometric values with configurable precision and rounding.
  • Decimal to Fraction Converters - Transforms high-precision decimal values into fractions with options to limit the maximum denominator size.
  • Iterative Refinement Methods - Calculates transcendental and root functions using repeated refinements to reach specified precision.
  • Exponent Scaling - Adjusts internal exponents to a common scale before performing arithmetic operations to maintain precision.
  • Numeric Data Formatting - Converts high-precision values into strings using fixed-point, exponential, or alternative base notations.
  • Monetary Precision Backends - Handles currency and monetary values using high-precision decimal representation and specific rounding modes.
  • Numeric and Math Utilities - Arbitrary-precision decimal type for JavaScript.

Star history

Star history chart for mikemcl/decimal.jsStar history chart for mikemcl/decimal.js

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. 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

Projects sharing features with Decimal.js

These projects share indexed features with Decimal.js. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • mikemcl/bignumber.jsMikeMcl avatar

    MikeMcl/bignumber.js

    7,004View on GitHub↗

    bignumber.js is an arbitrary-precision JavaScript library designed to perform mathematical operations on decimals and integers that exceed the limits of standard floating-point numbers. It functions as a decimal arithmetic engine and a math library for calculating square roots, powers, and modular exponentiation. The project provides a base conversion utility capable of parsing and translating numeric values between any base from 2 to 36. It also includes a numeric formatting tool for rendering high-precision values into localized strings with custom separators and notation styles. The libra

    JavaScript
    View on GitHub↗7,004
  • 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
  • nefe/number-precisionnefe avatar

    nefe/number-precision

    4,100View on GitHub↗

    number-precision is a JavaScript math library and arbitrary precision arithmetic utility. It provides a set of functions for performing addition, subtraction, multiplication, and division while avoiding the rounding errors common in standard binary floating-point operations. The project focuses on maintaining controlled decimal precision to ensure consistent mathematical output. This makes it applicable for financial calculations where exact currency values are required, as well as for high precision data processing in scientific or technical reports. Its capabilities include precise floatin

    TypeScriptfloating-pointnumber-converterrounding-error
    View on GitHub↗4,100
  • numbers/numbers.jsnumbers avatar

    numbers/numbers.js

    1,757View on GitHub↗

    numbers.js is a comprehensive mathematics library for JavaScript that provides a collection of advanced functions for scientific computing and data analysis. It is designed to handle complex mathematical operations through a modular architecture, offering tools for calculus, statistics, linear algebra, and prime number analysis. The library distinguishes itself by providing explicit control over numerical precision, allowing users to define error thresholds and manage decimal accuracy to mitigate rounding discrepancies. This focus on precision is paired with a suite of computational tools tha

    JavaScript
    View on GitHub↗1,757
Compare all 30 related projects→

Frequently asked questions

What does mikemcl/decimal.js do?

decimal.js is a JavaScript arbitrary precision library designed to perform mathematical calculations without the rounding errors associated with standard floating-point numbers. It provides a high-precision math toolkit for executing basic arithmetic and advanced transcendental functions with configurable significant digits.

What are the main features of mikemcl/decimal.js?

The main features of mikemcl/decimal.js are: JavaScript Math Libraries, Arbitrary Precision Arithmetic, Numeric Precision Management, Text-to-Numeric Parsing, String-to-Numeric Conversions, Rounding Utilities, Calculation Precision Configurations, Decimal Arithmetic Types.

Which projects share features with mikemcl/decimal.js?

Projects with overlapping indexed features include: mikemcl/bignumber.js — bignumber.js is an arbitrary-precision JavaScript library designed to perform mathematical operations on decimals and… mikemcl/big.js — big.js is an arbitrary-precision decimal library for JavaScript designed to perform exact decimal arithmetic. It… nefe/number-precision — number-precision is a JavaScript math library and arbitrary precision arithmetic utility. It provides a set of… numbers/numbers.js — numbers.js is a comprehensive mathematics library for JavaScript that provides a collection of advanced functions for… josdejong/mathjs — Math.js is a comprehensive JavaScript library for scientific, complex, and arbitrary precision calculations. It… stdlib-js/stdlib.