Skip to content

Commit cb3ed69

Browse files
committed
update documentation regarding fp_isprime()
1 parent 3142b0b commit cb3ed69

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tfm.tex

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,17 @@ \section{Prime Numbers}
412412
To quickly test a number for primality call this function.
413413

414414
\index{fp\_isprime}
415+
\index{fp\_isprime\_ex}
415416
\begin{verbatim}
416-
int fp_isprime(fp_int *a);
417+
int fp_isprime_ex(fp_int *a, int t);
417418
\end{verbatim}
418419
This will return \textbf{FP\_YES} if $a$ is probably prime. It uses 256 trial divisions and
419-
eight rounds of Rabin-Miller testing. Note that this routine performs modular exponentiations
420+
$t$ rounds of Rabin-Miller testing. Note that this routine performs modular exponentiations
420421
which means that $a$ must be in a valid range of precision.
422+
The valid range of $t$ is $1 \ldots 256$.
423+
424+
For backwards compatibility reasons the API function fp\_isprime(a) is still available
425+
and simply calls fp\_isprime\_ex(a, 8).
421426

422427
\chapter{Porting TomsFastMath}
423428
\label{chap:asmops}

0 commit comments

Comments
 (0)