Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #24667: Clean up partitions_c.cc
1. Remove some unused stuff. 2. Compute the `double` and `long double` constants using MPFR. This makes a lot of sense since we already computed MPFR versions of these constants anyway. For extra safety, we also increase the precision used to compute these constants. 3. No longer use the header file `partitions_c.h`. Instead, include the `.cc` file in Cython. Points 2. and 3. above allow to remove some platform-specific hacks. 4. Replace `T(int(x))` by `T(x)` to convert `x` to type `T`. 5. Only one temporary MPFR variable is really needed, call it `mptemp`. 6. Merge `initialize_mpz_and_mpq_variables`, `initialize_mpfr_variables` and `initialize_constants` in one function `initialize_globals`. 7. Use some more specialized MPFR functions like `mpfr_set_prec()` where applicable. 8. Define all internal functions as `static`. 9. Use `MPFR_RNDF` rounding mode where exact rounding is not required. 10. Ensure that the file compiles without compiler warnings. 11. Various style improvements. URL: https://trac.sagemath.org/24667 Reported by: jdemeyer Ticket author(s): Jeroen Demeyer Reviewer(s): Dima Pasechnik
- Loading branch information