flint icon indicating copy to clipboard operation
flint copied to clipboard

Missing `fmpz_tdiv_r`, `fmpz_cdiv_r`

Open mozhewen opened this issue 6 months ago • 0 comments

Is your feature request related to a problem? Please describe. fmpz_tdiv_r is useful in the implementation of the % operator in some languages for a wrapping type of fmpz. fmpz_cdiv_r may be useful in some other cases.

GMP does implement the corresponding mpz_tdiv_r and mpz_cdiv_r functions.

Describe the solution you'd like Add these functions.

Describe alternatives you've considered I can also use fmpz_tdiv_qr or fmpz_cdiv_qr and ignore the quotient, or make a conditional subtraction after mpz_fdiv_r. I'm not sure if these are suboptimal compared with directly calling mpz_t(c)div_r.

Additional context

mozhewen avatar Oct 23 '25 03:10 mozhewen