From 806428548a7e39faf346e993fc25749fd412e14d Mon Sep 17 00:00:00 2001 From: Vincent Neiger Date: Fri, 23 Aug 2024 12:16:02 +0200 Subject: [PATCH 1/3] doc fixes, to be checked for safety concerning udiv_qrnnd --- doc/source/fmpz_mod.rst | 2 +- doc/source/fmpz_mod_poly.rst | 2 +- doc/source/longlong.rst | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/source/fmpz_mod.rst b/doc/source/fmpz_mod.rst index 771993c05e..eca14a0394 100644 --- a/doc/source/fmpz_mod.rst +++ b/doc/source/fmpz_mod.rst @@ -42,7 +42,7 @@ Arithmetic -------------------------------------------------------------------------------- Unless specified otherwise all functions here expect their relevant arguments to be in the canonical range `[0,n)`. -Comparison of elements against each other or against zero can be accomplished with func::fmpz_equal or func::fmpz_is_zero without a context. +Comparison of elements against each other or against zero can be accomplished with :func:`fmpz_equal` or :func:`fmpz_is_zero` without a context. .. function:: int fmpz_mod_is_canonical(const fmpz_t a, const fmpz_mod_ctx_t ctx) diff --git a/doc/source/fmpz_mod_poly.rst b/doc/source/fmpz_mod_poly.rst index 5327046b1b..642aa853e1 100644 --- a/doc/source/fmpz_mod_poly.rst +++ b/doc/source/fmpz_mod_poly.rst @@ -1909,7 +1909,7 @@ Berlekamp-Massey Algorithm .. function:: const fmpz * fmpz_mod_berlekamp_massey_points(const fmpz_mod_berlekamp_massey_t B) - Return a pointer the array of points stored in ``B``. This may be ``NULL`` if func::fmpz_mod_berlekamp_massey_point_count returns ``0``. + Return a pointer the array of points stored in ``B``. This may be ``NULL`` if :func:`fmpz_mod_berlekamp_massey_point_count` returns ``0``. .. function:: const fmpz_mod_poly_struct * fmpz_mod_berlekamp_massey_V_poly(const fmpz_mod_berlekamp_massey_t B) diff --git a/doc/source/longlong.rst b/doc/source/longlong.rst index e7ee6df79f..fcad189a3b 100644 --- a/doc/source/longlong.rst +++ b/doc/source/longlong.rst @@ -80,7 +80,7 @@ Division .. macro:: udiv_qrnnd(q, r, n1, n0, d) Computes the non-negative integers `q` and `r` in `d q + r = n_1 B + n_0`, - where `B = 2^{\mathtt{FLINT\_BITS}}`. Assumes that `d < n_1`. + where `B = 2^{\mathtt{FLINT\_BITS}}`. Assumes that `n_1 < d`. .. macro:: sdiv_qrnnd(quotient, remainder, high_numerator, low_numerator, denominator) @@ -89,4 +89,4 @@ Division .. macro:: udiv_qrnnd_preinv(q, r, n1, n0, d, di) Works like ``udiv_qrnnd``, but takes a precomputed inverse ``di`` as - computed by ::func::`n_preinvert_limb`. + computed by :func:`n_preinvert_limb`. From d8437317b306cc02fc22e5139d53a383da0de247 Mon Sep 17 00:00:00 2001 From: Vincent Neiger Date: Fri, 23 Aug 2024 16:00:05 +0200 Subject: [PATCH 2/3] prenorm --- doc/source/longlong.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/longlong.rst b/doc/source/longlong.rst index fcad189a3b..de7e64a776 100644 --- a/doc/source/longlong.rst +++ b/doc/source/longlong.rst @@ -89,4 +89,4 @@ Division .. macro:: udiv_qrnnd_preinv(q, r, n1, n0, d, di) Works like ``udiv_qrnnd``, but takes a precomputed inverse ``di`` as - computed by :func:`n_preinvert_limb`. + computed by :func:`n_preinvert_limb_prenorm`. From b020fafd0912c1d7be3ec33c082398462e1c50d3 Mon Sep 17 00:00:00 2001 From: Vincent Neiger Date: Fri, 23 Aug 2024 16:08:11 +0200 Subject: [PATCH 3/3] fix doc to mention the normalized requirement --- doc/source/longlong.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/source/longlong.rst b/doc/source/longlong.rst index de7e64a776..bcfdd6cf67 100644 --- a/doc/source/longlong.rst +++ b/doc/source/longlong.rst @@ -89,4 +89,5 @@ Division .. macro:: udiv_qrnnd_preinv(q, r, n1, n0, d, di) Works like ``udiv_qrnnd``, but takes a precomputed inverse ``di`` as - computed by :func:`n_preinvert_limb_prenorm`. + computed by :func:`n_preinvert_limb_prenorm`. This function assumes ``d`` + is normalised, i.e. with most significant bit set.