Thriving Thriving C++ C+ HTML HT
โ†‘ 37 ?
preclib ILearnedSomeCoding/preclib

A simple multi-precision C++ library, now with a CAS. A simple high-precision C++ library: more for the same price, with a CAS included at no extra cost.

HEALTH ? 70 / Stable
// solo builder// hidden gem ?

// readme

preclib

preclib is an experimental C++17 high-precision computation library. Integers use little-endian 64-bit limbs; multiplication and division select different algorithms depending on operand size. The repository also includes a ฯ€ computation program, an interactive calculator, symbolic computation (CAS), and test and benchmark programs.

This project is mainly intended for researching, validating, and comparing high-precision algorithms. Its API and ABI are not yet stable, and it is not recommended as a direct replacement for the long-established GMP.

Numeric Types

TypeHeaderPurpose
precn_tprec.hppNon-negative arbitrary-precision integer
precz_tprec.hppSigned arbitrary-precision integer
precq_tprec.hppRational number automatically reduced to lowest terms
precf_tprec.hppFixed-point number using the global binary precision
Numberprec_num.hppBinary floating-point number whose precision is recorded per object

For general integer operations, precz_t is recommended; for non-integer approximate computation, Number is recommended. The value of precn_t is `a[0] + a[1] *โ€ฆ