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
// 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
| Type | Header | Purpose |
|---|---|---|
precn_t | prec.hpp | Non-negative arbitrary-precision integer |
precz_t | prec.hpp | Signed arbitrary-precision integer |
precq_t | prec.hpp | Rational number automatically reduced to lowest terms |
precf_t | prec.hpp | Fixed-point number using the global binary precision |
Number | prec_num.hpp | Binary 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] *โฆ