arbitrary-precision

Top 23 arbitrary-precision Open-Source Projects

  • bignumber.js

    A JavaScript library for arbitrary-precision decimal and non-decimal arithmetic

  • Project mention: eslint-plugin-big-number-rules: Enforce finance-safe calculations (helps 0.1 + 0.2 really equal 0.3) | /r/javascript | 2023-06-03

    If you use floating-points for currency (instead of whole-numbers like you probably should) libraries like bignumber.js help keep your code away from the binary floating-point pitfalls of IEEE-754 which manifests in the standard JavaScript number type:

  • decimal.js

    An arbitrary-precision Decimal type for JavaScript

  • Project mention: Floats Are Weird | news.ycombinator.com | 2024-02-19
  • InfluxDB

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

    InfluxDB logo
  • big.js

    A small, fast JavaScript library for arbitrary-precision decimal arithmetic.

  • Project mention: Decoding Why 0.6 + 0.3 = 0.8999999999999999 in JS and How to Solve? | dev.to | 2023-11-16

    ii) Third-Party Libraries There are various libraries like math.js, decimal.js, big.js that solve the problem. Each library functions according to its documentation. This approach is comparatively better.

  • Brick\Math

    Arbitrary-precision arithmetic library for PHP (by brick)

  • Project mention: PHP libraries and tools | dev.to | 2023-10-18

    brick/math: Arbitrary-precision arithmetic library for PHP

  • mpmath

    Python library for arbitrary-precision floating-point arithmetic

  • Project mention: mpmath – Python library for arbitrary-precision floating-point arithmetic | news.ycombinator.com | 2024-01-19
  • AngouriMath

    New open-source cross-platform symbolic algebra library for C# and F#. Can be used for both production and research purposes.

  • decimal

    A high-performance, arbitrary-precision, floating-point decimal library. (by ericlagergren)

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • Measurements.jl

    Error propagation calculator and library for physical measurements. It supports real and complex numbers with uncertainty, arbitrary precision calculations, operations with arrays, and numerical integration.

  • arb

    Arb has been merged into FLINT -- use https://github.com/flintlib/flint/ instead

  • Project mention: Patriot Missile Floating point Software Problem lead to deaths 28 Americans | news.ycombinator.com | 2024-01-03

    You can instead list your criteria for good number format and look at alternatives with those lenses. Floating point is designed for a good balance between dynamic range and precision, and IEEE 754 binary formats can be seen as a FP standard particularly optimized for numerical calculation.

    There are several other FP formats. The most popular one is IEEE 754 minus subnormal numbers, followed by bfloat16, IEEE 754 decimal formats (formerly IEEE 854) and posits. Only first two have good hardware supports. The lack of subnormal number means that `a <=> b` can't be no longer rewritten to `a - b <=> 0` among others but is widely believed to be faster. (I don't fully agree, but it's indeed true for existing contemporary hardwares.) IEEE 754 decimal formats are notable for lack of normalization guarantee. Posits are, in some sense, what IEEE 754 would have been if designed today, and in fact aren't that fundamentally different from IEEE 754 in my opinion.

    Fixed-point formats share pros and cons of finitely sized integer numbers and you should have no difficulty to analyze them. In short, they offer a smaller dynamic range compared to FP, but its truncation model is much simpler to reason. In turn you will get a varying precision and out-of-bound issues.

    Rational number formats look very promising at the beginning, but they are much harder to implement efficiently. You will need a fast GCD algorithm (not Euclidean) and also have to handle out-of-bound numerators and denumerators. In fact, many rational number formats rely on arbitrary-precision integers precisely for avoiding those issues, and inherit the same set of issues---unbounded memory usage and computational overhead. Approximate rational number formats are much rarer, and I'm only aware of the Inigo Quilez's floating-bar experiment [1] in this space.

    [1] https://iquilezles.org/articles/floatingbar/

    Interval/ball/affine arithmetics and others are means to automatically approximate an error analysis. They have a good property of being never incorrect, but it is still really easy for them to throw up and give a correct but useless answer like [-inf, inf]. Also they are somewhat awkward in a typical procedural paradigm because comparisons will return a tri-state boolean (true, false, unsure). Nevertheless they are often useful when correctly used. Fredrik Johansson's Arb [2] is a good starting point in my opinion.

    [2] https://arblib.org/

    Finally you can model a number as a function that returns a successively accurate approximation. This is called the constructive or exact real number, and simultaneously most expensive and most correct. One of the most glaring problems is that an equality is not always decidable, and practical applications tend to have various heuristics to get around this fact. Amazingly enough, Android's built-in calculator is one of the most used applications that use this model [3].

    [3] https://dl.acm.org/doi/pdf/10.1145/2911981

  • tiny-bignum-c

    Small portable multiple-precision unsigned integer arithmetic in C

  • kotlin-multiplatform-bignum

    A Kotlin multiplatform library for arbitrary precision arithmetics

  • calc

    C-style arbitrary precision calculator

  • Project mention: Calc: C-style arbitrary precision calculator | news.ycombinator.com | 2024-04-10
  • Swift-BigInt

    A lightweight, Arbitrary Precision Arithmetic Library for Swift!

  • wide-integer

    Wide-Integer implements a generic C++ template for uint128_t, uint256_t, uint512_t, uint1024_t, etc.

  • imath

    Arbitrary precision integer and rational arithmetic library (by creachadair)

  • astro-float

    Arbitrary precision floating point numbers library

  • Project mention: Has anyone worked on a math library before? | /r/rust | 2023-05-06

    I am working on https://github.com/stencillogic/astro-float

  • nim-stint

    Stack-based arbitrary-precision integers - Fast and portable with natural syntax for resource-restricted devices.

  • Project mention: Stint (Stack-based multiprecision integers) | news.ycombinator.com | 2023-07-03
  • Rationals

    🔟 Implementation of rational number arithmetic for .NET with arbitrary precision.

  • dashu

    A library set of arbitrary precision numbers implemented in Rust.

  • Fermat

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

  • big decimal

    An arbitrary-precision decimal floating-point arithmetic package for Go (by db47h)

  • reduce-algebra

    reduce-algebra: a portable general-purpose computer algebra system, automatically mirrored from https://svn.code.sf.net/p/reduce-algebra/code/. Please visit the REDUCE Homepage, https://reduce-algebra.sourceforge.io/, to report any bugs or request assistance.

  • computable-reals

    Arbitrary precision, automatic re-computing real numbers in Common Lisp.

  • Project mention: Could numerical operations be optimized by using algebraic properties that are not present in floating point operations but in numbers that have infinite precision? | /r/ProgrammingLanguages | 2023-06-09

    You can use computable real numbers which are data structures which can compute, on demand, any precision you want. Even for irrational numbers or arbitrary combinations of them. This is essentially a programmatic way to encode Cauchy sequences. Here's an implementation in Common Lisp.

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020).

arbitrary-precision related posts

Index

What are some of the best open-source arbitrary-precision projects? This list will help you:

Project Stars
1 bignumber.js 6,517
2 decimal.js 6,113
3 big.js 4,679
4 Brick\Math 1,736
5 mpmath 906
6 AngouriMath 754
7 decimal 490
8 Measurements.jl 470
9 arb 455
10 tiny-bignum-c 409
11 kotlin-multiplatform-bignum 321
12 calc 316
13 Swift-BigInt 233
14 wide-integer 176
15 imath 123
16 astro-float 94
17 nim-stint 77
18 Rationals 76
19 dashu 71
20 Fermat 64
21 big decimal 38
22 reduce-algebra 31
23 computable-reals 28

Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com