nmod.h – integers mod n (word-size n)

20 views
Skip to first unread message

P. Padilla

unread,
Jun 29, 2025, 4:16:42 AMJun 29
to flint-devel
Sorry if this is a dumb question but I'm having trouble understanding the subject type.  Is n the number of bits in the word (e.g. 64 for most modern machines) or is it the number of 64-bit words to use? Thank you.


Regards
Pete

Albin Ahlbäck

unread,
Jun 29, 2025, 1:48:55 PMJun 29
to flint...@googlegroups.com, P. Padilla
Hi Pete,

`n' is the modulus, `ninv' is a precomputed inverse (have a look at the
paper by Granlund and Möller), and `norm' is the number of bits required
to "normalize" `n' (smallest `x' such that `n << x' sets the most
significant bit).

So to answer your question: neither.

Best,
Albin
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "flint-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to flint-devel...@googlegroups.com <mailto:flint-
> devel+un...@googlegroups.com>.
> To view this discussion, visit https://groups.google.com/d/msgid/flint-
> devel/68552177-a71f-445f-bee7-a1b33352da6cn%40googlegroups.com <https://
> groups.google.com/d/msgid/flint-devel/68552177-a71f-445f-bee7-
> a1b33352da6cn%40googlegroups.com?utm_medium=email&utm_source=footer>.

ppadi...@gmail.com

unread,
Jun 29, 2025, 5:25:55 PMJun 29
to Albin Ahlbäck, flint...@googlegroups.com
Ah, ok. Thanks.
Reply all
Reply to author
Forward
0 new messages