\hypertarget{reken_8c}{}\doxysection{reken.\+c File Reference}
\label{reken_8c}\index{reken.c@{reken.c}}
{\ttfamily \#include \char`\"{}form3.\+h\char`\"{}}\newline
{\ttfamily \#include $<$math.\+h$>$}\newline
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{reken_8c_a5b4f0037cfc631d9557066f9aa202f75}\label{reken_8c_a5b4f0037cfc631d9557066f9aa202f75}} 
\#define {\bfseries G\+C\+D\+M\+AX}~3
\item 
\mbox{\Hypertarget{reken_8c_a27b931ddc61a40bc3b19656b6e2266cb}\label{reken_8c_a27b931ddc61a40bc3b19656b6e2266cb}} 
\#define {\bfseries N\+E\+W\+T\+R\+I\+CK}~1
\item 
\mbox{\Hypertarget{reken_8c_a16a0847dd2aafab661f9999ba3ab7ceb}\label{reken_8c_a16a0847dd2aafab661f9999ba3ab7ceb}} 
\#define {\bfseries C\+O\+P\+Y\+L\+O\+NG}(x1,  nx1,  x2,  nx2)~\{ int i; for(i=0;i$<$A\+BS(nx2);i++)x1\mbox{[}i\mbox{]}=x2\mbox{[}i\mbox{]};nx1=nx2; \}
\item 
\mbox{\Hypertarget{reken_8c_add862aa2681c9a3b358a21c768555cda}\label{reken_8c_add862aa2681c9a3b358a21c768555cda}} 
\#define {\bfseries W\+A\+R\+M\+UP}~6
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{reken_8c_a82e463d959511f0979cb428929936b01}\label{reken_8c_a82e463d959511f0979cb428929936b01}} 
V\+O\+ID {\bfseries Pack} (U\+W\+O\+RD $\ast$a, W\+O\+RD $\ast$na, U\+W\+O\+RD $\ast$b, W\+O\+RD nb)
\item 
\mbox{\Hypertarget{reken_8c_a32372d40876659eb9ad0c14ca5080a4e}\label{reken_8c_a32372d40876659eb9ad0c14ca5080a4e}} 
V\+O\+ID {\bfseries Un\+Pack} (U\+W\+O\+RD $\ast$a, W\+O\+RD na, W\+O\+RD $\ast$denom, W\+O\+RD $\ast$numer)
\item 
\mbox{\Hypertarget{reken_8c_aa0ed09481471f3318857ad5881654c82}\label{reken_8c_aa0ed09481471f3318857ad5881654c82}} 
W\+O\+RD {\bfseries Mully} (P\+H\+E\+AD U\+W\+O\+RD $\ast$a, W\+O\+RD $\ast$na, U\+W\+O\+RD $\ast$b, W\+O\+RD nb)
\item 
\mbox{\Hypertarget{reken_8c_a223ce1b5d8711bd0ed7b9ddb6d634af6}\label{reken_8c_a223ce1b5d8711bd0ed7b9ddb6d634af6}} 
W\+O\+RD {\bfseries Divvy} (P\+H\+E\+AD U\+W\+O\+RD $\ast$a, W\+O\+RD $\ast$na, U\+W\+O\+RD $\ast$b, W\+O\+RD nb)
\item 
\mbox{\Hypertarget{reken_8c_aecd2f9b146f3f469bb47ea3d08dd8e19}\label{reken_8c_aecd2f9b146f3f469bb47ea3d08dd8e19}} 
W\+O\+RD {\bfseries Add\+Rat} (P\+H\+E\+AD U\+W\+O\+RD $\ast$a, W\+O\+RD na, U\+W\+O\+RD $\ast$b, W\+O\+RD nb, U\+W\+O\+RD $\ast$c, W\+O\+RD $\ast$nc)
\item 
\mbox{\Hypertarget{reken_8c_a4e5ec52278cc794afa8fe354220c4144}\label{reken_8c_a4e5ec52278cc794afa8fe354220c4144}} 
W\+O\+RD {\bfseries Mul\+Rat} (P\+H\+E\+AD U\+W\+O\+RD $\ast$a, W\+O\+RD na, U\+W\+O\+RD $\ast$b, W\+O\+RD nb, U\+W\+O\+RD $\ast$c, W\+O\+RD $\ast$nc)
\item 
\mbox{\Hypertarget{reken_8c_a9ccba921bba11655984533c8890ff518}\label{reken_8c_a9ccba921bba11655984533c8890ff518}} 
W\+O\+RD {\bfseries Div\+Rat} (P\+H\+E\+AD U\+W\+O\+RD $\ast$a, W\+O\+RD na, U\+W\+O\+RD $\ast$b, W\+O\+RD nb, U\+W\+O\+RD $\ast$c, W\+O\+RD $\ast$nc)
\item 
\mbox{\Hypertarget{reken_8c_a561f1b236e4bcfdc856d9f1278b667e0}\label{reken_8c_a561f1b236e4bcfdc856d9f1278b667e0}} 
W\+O\+RD {\bfseries Simplify} (P\+H\+E\+AD U\+W\+O\+RD $\ast$a, W\+O\+RD $\ast$na, U\+W\+O\+RD $\ast$b, W\+O\+RD $\ast$nb)
\item 
\mbox{\Hypertarget{reken_8c_af128b5c878d5ee91aae1784b3e351ab0}\label{reken_8c_af128b5c878d5ee91aae1784b3e351ab0}} 
W\+O\+RD {\bfseries Accum\+G\+CD} (P\+H\+E\+AD U\+W\+O\+RD $\ast$a, W\+O\+RD $\ast$na, U\+W\+O\+RD $\ast$b, W\+O\+RD nb)
\item 
\mbox{\Hypertarget{reken_8c_a77061eca0b65bea35f501aa1ddb024e4}\label{reken_8c_a77061eca0b65bea35f501aa1ddb024e4}} 
int {\bfseries Take\+Rat\+Root} (U\+W\+O\+RD $\ast$a, W\+O\+RD $\ast$n, W\+O\+RD power)
\item 
\mbox{\Hypertarget{reken_8c_a3ca1586badbcb460ec0d5c5c00a85934}\label{reken_8c_a3ca1586badbcb460ec0d5c5c00a85934}} 
W\+O\+RD {\bfseries Add\+Long} (U\+W\+O\+RD $\ast$a, W\+O\+RD na, U\+W\+O\+RD $\ast$b, W\+O\+RD nb, U\+W\+O\+RD $\ast$c, W\+O\+RD $\ast$nc)
\item 
\mbox{\Hypertarget{reken_8c_a1947f1c15a1c1d566d08bdfc70f07c86}\label{reken_8c_a1947f1c15a1c1d566d08bdfc70f07c86}} 
W\+O\+RD {\bfseries Add\+P\+Lon} (U\+W\+O\+RD $\ast$a, W\+O\+RD na, U\+W\+O\+RD $\ast$b, W\+O\+RD nb, U\+W\+O\+RD $\ast$c, W\+O\+RD $\ast$nc)
\item 
\mbox{\Hypertarget{reken_8c_a6e7bf669b5d4d09187221e2a36daf2fd}\label{reken_8c_a6e7bf669b5d4d09187221e2a36daf2fd}} 
V\+O\+ID {\bfseries Sub\+P\+Lon} (U\+W\+O\+RD $\ast$a, W\+O\+RD na, U\+W\+O\+RD $\ast$b, W\+O\+RD nb, U\+W\+O\+RD $\ast$c, W\+O\+RD $\ast$nc)
\item 
\mbox{\Hypertarget{reken_8c_af0c190ab38803891dd73d0ec8b79644d}\label{reken_8c_af0c190ab38803891dd73d0ec8b79644d}} 
W\+O\+RD {\bfseries Mul\+Long} (U\+W\+O\+RD $\ast$a, W\+O\+RD na, U\+W\+O\+RD $\ast$b, W\+O\+RD nb, U\+W\+O\+RD $\ast$c, W\+O\+RD $\ast$nc)
\item 
\mbox{\Hypertarget{reken_8c_aade5ffb0b4da64f7db88811e4f8ed3a1}\label{reken_8c_aade5ffb0b4da64f7db88811e4f8ed3a1}} 
W\+O\+RD {\bfseries Big\+Long} (U\+W\+O\+RD $\ast$a, W\+O\+RD na, U\+W\+O\+RD $\ast$b, W\+O\+RD nb)
\item 
\mbox{\Hypertarget{reken_8c_a3d07c13cc32c3946fd83d139487c5641}\label{reken_8c_a3d07c13cc32c3946fd83d139487c5641}} 
W\+O\+RD {\bfseries Div\+Long} (U\+W\+O\+RD $\ast$a, W\+O\+RD na, U\+W\+O\+RD $\ast$b, W\+O\+RD nb, U\+W\+O\+RD $\ast$c, W\+O\+RD $\ast$nc, U\+W\+O\+RD $\ast$d, W\+O\+RD $\ast$nd)
\item 
\mbox{\Hypertarget{reken_8c_a3d3fd38f2a23b05665ed4da9c394df38}\label{reken_8c_a3d3fd38f2a23b05665ed4da9c394df38}} 
W\+O\+RD {\bfseries Rais\+Pow} (P\+H\+E\+AD U\+W\+O\+RD $\ast$a, W\+O\+RD $\ast$na, U\+W\+O\+RD b)
\item 
V\+O\+ID \mbox{\hyperlink{reken_8c_a65b7b140eab3dded6d6fce6e6a82fe83}{Rais\+Pow\+Cached}} (P\+H\+E\+AD W\+O\+RD x, W\+O\+RD n, U\+W\+O\+RD $\ast$$\ast$c, W\+O\+RD $\ast$nc)
\item 
\mbox{\Hypertarget{reken_8c_a6c628f5c5d4bb1e919e9e6ded9638441}\label{reken_8c_a6c628f5c5d4bb1e919e9e6ded9638441}} 
W\+O\+RD {\bfseries Rais\+Pow\+Mod} (W\+O\+RD x, W\+O\+RD n, W\+O\+RD m)
\item 
int \mbox{\hyperlink{reken_8c_aa1fcbc96fd8ca92f950bc0ee520e6684}{Normal\+Modulus}} (U\+W\+O\+RD $\ast$a, W\+O\+RD $\ast$na)
\item 
int \mbox{\hyperlink{reken_8c_a97978538ffb2abdfdbbe993f30205030}{Make\+Inverses}} ()
\item 
int \mbox{\hyperlink{reken_8c_a0eefedce674c6f8de9955735abddb7fe}{Get\+Mod\+Inverses}} (W\+O\+RD m1, W\+O\+RD m2, W\+O\+RD $\ast$im1, W\+O\+RD $\ast$im2)
\item 
\mbox{\Hypertarget{reken_8c_a2e157a696c4d19c7771c89a0d420fc54}\label{reken_8c_a2e157a696c4d19c7771c89a0d420fc54}} 
int {\bfseries Get\+Long\+Mod\+Inverses} (P\+H\+E\+AD U\+W\+O\+RD $\ast$a, W\+O\+RD na, U\+W\+O\+RD $\ast$b, W\+O\+RD nb, U\+W\+O\+RD $\ast$ia, W\+O\+RD $\ast$nia, U\+W\+O\+RD $\ast$ib, W\+O\+RD $\ast$nib)
\item 
\mbox{\Hypertarget{reken_8c_a88cb9429ee835fbdaee994a7a446c0e2}\label{reken_8c_a88cb9429ee835fbdaee994a7a446c0e2}} 
W\+O\+RD {\bfseries Product} (U\+W\+O\+RD $\ast$a, W\+O\+RD $\ast$na, W\+O\+RD b)
\item 
\mbox{\Hypertarget{reken_8c_a4e5b1e49726339083409c01ccae05c83}\label{reken_8c_a4e5b1e49726339083409c01ccae05c83}} 
U\+W\+O\+RD {\bfseries Quotient} (U\+W\+O\+RD $\ast$a, W\+O\+RD $\ast$na, W\+O\+RD b)
\item 
\mbox{\Hypertarget{reken_8c_a67f3dddaaa145810e6276a3caa5f2443}\label{reken_8c_a67f3dddaaa145810e6276a3caa5f2443}} 
W\+O\+RD {\bfseries Remain10} (U\+W\+O\+RD $\ast$a, W\+O\+RD $\ast$na)
\item 
\mbox{\Hypertarget{reken_8c_ac45a4cc4edb97f61b81817b9c0bc31c7}\label{reken_8c_ac45a4cc4edb97f61b81817b9c0bc31c7}} 
W\+O\+RD {\bfseries Remain4} (U\+W\+O\+RD $\ast$a, W\+O\+RD $\ast$na)
\item 
\mbox{\Hypertarget{reken_8c_a650f363a0a48f1b87359de4b8ee38cb6}\label{reken_8c_a650f363a0a48f1b87359de4b8ee38cb6}} 
V\+O\+ID {\bfseries Prt\+Long} (U\+W\+O\+RD $\ast$a, W\+O\+RD na, U\+B\+Y\+TE $\ast$s)
\item 
\mbox{\Hypertarget{reken_8c_a40f84e5d6924663523acd9137b55a027}\label{reken_8c_a40f84e5d6924663523acd9137b55a027}} 
W\+O\+RD {\bfseries Get\+Long} (U\+B\+Y\+TE $\ast$s, U\+W\+O\+RD $\ast$a, W\+O\+RD $\ast$na)
\item 
\mbox{\Hypertarget{reken_8c_a41f16b9fd783530830abd75655df3ad3}\label{reken_8c_a41f16b9fd783530830abd75655df3ad3}} 
W\+O\+RD {\bfseries Gcd\+Long} (P\+H\+E\+AD U\+W\+O\+RD $\ast$a, W\+O\+RD na, U\+W\+O\+RD $\ast$b, W\+O\+RD nb, U\+W\+O\+RD $\ast$c, W\+O\+RD $\ast$nc)
\item 
\mbox{\Hypertarget{reken_8c_aef04e986cbcc0f3576badf04f6ef2dbb}\label{reken_8c_aef04e986cbcc0f3576badf04f6ef2dbb}} 
W\+O\+RD {\bfseries Get\+Binom} (U\+W\+O\+RD $\ast$a, W\+O\+RD $\ast$na, W\+O\+RD i1, W\+O\+RD i2)
\item 
\mbox{\Hypertarget{reken_8c_afff5539baaed98b019908528defe3002}\label{reken_8c_afff5539baaed98b019908528defe3002}} 
W\+O\+RD {\bfseries Lcm\+Long} (P\+H\+E\+AD U\+W\+O\+RD $\ast$a, W\+O\+RD na, U\+W\+O\+RD $\ast$b, W\+O\+RD nb, U\+W\+O\+RD $\ast$c, W\+O\+RD $\ast$nc)
\item 
\mbox{\Hypertarget{reken_8c_a3d5c3aff68de5fc94f623e6ccf9d3b40}\label{reken_8c_a3d5c3aff68de5fc94f623e6ccf9d3b40}} 
int {\bfseries Take\+Long\+Root} (U\+W\+O\+RD $\ast$a, W\+O\+RD $\ast$n, W\+O\+RD power)
\item 
\mbox{\Hypertarget{reken_8c_ab9931330c8faf9090fe06221b19281d0}\label{reken_8c_ab9931330c8faf9090fe06221b19281d0}} 
int {\bfseries Make\+Rational} (W\+O\+RD a, W\+O\+RD m, W\+O\+RD $\ast$b, W\+O\+RD $\ast$c)
\item 
\mbox{\Hypertarget{reken_8c_a33dff5d7d3aebafb5c4c30415582bc5d}\label{reken_8c_a33dff5d7d3aebafb5c4c30415582bc5d}} 
int {\bfseries Make\+Long\+Rational} (P\+H\+E\+AD U\+W\+O\+RD $\ast$a, W\+O\+RD na, U\+W\+O\+RD $\ast$m, W\+O\+RD nm, U\+W\+O\+RD $\ast$b, W\+O\+RD $\ast$nb)
\item 
W\+O\+RD \mbox{\hyperlink{reken_8c_af384113a0d550c378c47310f17471f43}{Comp\+Coef}} (W\+O\+RD $\ast$term1, W\+O\+RD $\ast$term2)
\item 
\mbox{\Hypertarget{reken_8c_a2fd06daf96a870a638d251ab51feb064}\label{reken_8c_a2fd06daf96a870a638d251ab51feb064}} 
W\+O\+RD {\bfseries Modulus} (W\+O\+RD $\ast$term)
\item 
\mbox{\Hypertarget{reken_8c_af2c81be8426607b5ab2683628a61125f}\label{reken_8c_af2c81be8426607b5ab2683628a61125f}} 
W\+O\+RD {\bfseries Take\+Modulus} (U\+W\+O\+RD $\ast$a, W\+O\+RD $\ast$na, U\+W\+O\+RD $\ast$cmodvec, W\+O\+RD ncmod, W\+O\+RD par)
\item 
\mbox{\Hypertarget{reken_8c_ae1d4f9854f5478f0213a319100927681}\label{reken_8c_ae1d4f9854f5478f0213a319100927681}} 
W\+O\+RD {\bfseries Take\+Normal\+Modulus} (U\+W\+O\+RD $\ast$a, W\+O\+RD $\ast$na, U\+W\+O\+RD $\ast$c, W\+O\+RD nc, W\+O\+RD par)
\item 
\mbox{\Hypertarget{reken_8c_a4fcd21571b54956a9544f580d3ad7c45}\label{reken_8c_a4fcd21571b54956a9544f580d3ad7c45}} 
W\+O\+RD {\bfseries Make\+Mod\+Table} ()
\item 
\mbox{\Hypertarget{reken_8c_a00111b1520e65ce88516371231bcb1c0}\label{reken_8c_a00111b1520e65ce88516371231bcb1c0}} 
int {\bfseries Factorial} (P\+H\+E\+AD W\+O\+RD n, U\+W\+O\+RD $\ast$a, W\+O\+RD $\ast$na)
\item 
\mbox{\Hypertarget{reken_8c_afbebfe0cadc8e69533da84b33c67136f}\label{reken_8c_afbebfe0cadc8e69533da84b33c67136f}} 
int {\bfseries Bernoulli} (W\+O\+RD n, U\+W\+O\+RD $\ast$a, W\+O\+RD $\ast$na)
\item 
W\+O\+RD \mbox{\hyperlink{reken_8c_ae894a9ae7aab38972d59b5f49a1ad4b1}{Next\+Prime}} (P\+H\+E\+AD W\+O\+RD num)
\item 
\mbox{\Hypertarget{reken_8c_af5b18ac3fdbba2210d894da05f4315ff}\label{reken_8c_af5b18ac3fdbba2210d894da05f4315ff}} 
void {\bfseries iniwranf} (P\+H\+E\+A\+D0)
\item 
\mbox{\Hypertarget{reken_8c_a2b2d2fe1a7bf5522d7536a71880f879a}\label{reken_8c_a2b2d2fe1a7bf5522d7536a71880f879a}} 
U\+W\+O\+RD {\bfseries wranf} (P\+H\+E\+A\+D0)
\item 
\mbox{\Hypertarget{reken_8c_a62366780edc95b2575282550f949e0f7}\label{reken_8c_a62366780edc95b2575282550f949e0f7}} 
U\+W\+O\+RD {\bfseries iranf} (P\+H\+E\+AD U\+W\+O\+RD imax)
\item 
\mbox{\Hypertarget{reken_8c_a315f6ec5957e069f10a533b918a21181}\label{reken_8c_a315f6ec5957e069f10a533b918a21181}} 
U\+B\+Y\+TE $\ast$ {\bfseries Pre\+Random} (U\+B\+Y\+TE $\ast$s)
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
This file contains the numerical routines. The arithmetic in F\+O\+RM is normally over the rational numbers. Hence there are routines for dealing with integers and with rational of \textquotesingle{}arbitrary precision\textquotesingle{} (within limits) There are also routines for that calculus modulus an integer. In addition there are the routines for factorials and bernoulli numbers. The random number function is currently only for internal purposes. 

\doxysubsection{Function Documentation}
\mbox{\Hypertarget{reken_8c_a65b7b140eab3dded6d6fce6e6a82fe83}\label{reken_8c_a65b7b140eab3dded6d6fce6e6a82fe83}} 
\index{reken.c@{reken.c}!RaisPowCached@{RaisPowCached}}
\index{RaisPowCached@{RaisPowCached}!reken.c@{reken.c}}
\doxysubsubsection{\texorpdfstring{RaisPowCached()}{RaisPowCached()}}
{\footnotesize\ttfamily V\+O\+ID Rais\+Pow\+Cached (\begin{DoxyParamCaption}\item[{P\+H\+E\+AD W\+O\+RD}]{x,  }\item[{W\+O\+RD}]{n,  }\item[{U\+W\+O\+RD $\ast$$\ast$}]{c,  }\item[{W\+O\+RD $\ast$}]{nc }\end{DoxyParamCaption})}

Computes power x$^\wedge$n and caches the value\hypertarget{reken_8c_autotoc_md118}{}\doxysubsection{Description}\label{reken_8c_autotoc_md118}
Calculates the power x$^\wedge$n and stores the results for caching purposes. The pointer c (i.\+e., the pointer, and not what it points to) is overwritten. What it points to should not be overwritten in the calling function.\hypertarget{reken_8c_autotoc_md119}{}\doxysubsection{Notes}\label{reken_8c_autotoc_md119}

\begin{DoxyItemize}
\item Caching is done in A\+T.\+small\+\_\+power\mbox{[}\mbox{]}. This array is extended if necessary. 
\end{DoxyItemize}

Definition at line 1286 of file reken.\+c.



Referenced by poly\+::divmod\+\_\+univar(), and poly\+::mul\+\_\+heap().

\mbox{\Hypertarget{reken_8c_aa1fcbc96fd8ca92f950bc0ee520e6684}\label{reken_8c_aa1fcbc96fd8ca92f950bc0ee520e6684}} 
\index{reken.c@{reken.c}!NormalModulus@{NormalModulus}}
\index{NormalModulus@{NormalModulus}!reken.c@{reken.c}}
\doxysubsubsection{\texorpdfstring{NormalModulus()}{NormalModulus()}}
{\footnotesize\ttfamily int Normal\+Modulus (\begin{DoxyParamCaption}\item[{U\+W\+O\+RD $\ast$}]{a,  }\item[{W\+O\+RD $\ast$}]{na }\end{DoxyParamCaption})}

Brings a modular representation in the range -\/p/2 to +p/2 The return value tells whether anything was done. Routine made in the general modulus revamp of July 2008 (JV). 

Definition at line 1393 of file reken.\+c.

\mbox{\Hypertarget{reken_8c_a97978538ffb2abdfdbbe993f30205030}\label{reken_8c_a97978538ffb2abdfdbbe993f30205030}} 
\index{reken.c@{reken.c}!MakeInverses@{MakeInverses}}
\index{MakeInverses@{MakeInverses}!reken.c@{reken.c}}
\doxysubsubsection{\texorpdfstring{MakeInverses()}{MakeInverses()}}
{\footnotesize\ttfamily int Make\+Inverses (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

Makes a table of inverses in modular calculus The modulus is in A\+C.\+cmod and A\+C.\+ncmod One should notice that the table of inverses can only be made if the modulus fits inside a single F\+O\+RM word. Otherwise the table lookup becomes too difficult and the table too long. 

Definition at line 1430 of file reken.\+c.

\mbox{\Hypertarget{reken_8c_a0eefedce674c6f8de9955735abddb7fe}\label{reken_8c_a0eefedce674c6f8de9955735abddb7fe}} 
\index{reken.c@{reken.c}!GetModInverses@{GetModInverses}}
\index{GetModInverses@{GetModInverses}!reken.c@{reken.c}}
\doxysubsubsection{\texorpdfstring{GetModInverses()}{GetModInverses()}}
{\footnotesize\ttfamily int Get\+Mod\+Inverses (\begin{DoxyParamCaption}\item[{W\+O\+RD}]{m1,  }\item[{W\+O\+RD}]{m2,  }\item[{W\+O\+RD $\ast$}]{im1,  }\item[{W\+O\+RD $\ast$}]{im2 }\end{DoxyParamCaption})}

Input m1 and m2, which are relative prime. determines a$\ast$m1+b$\ast$m2 = 1 (and 1 is the gcd of m1 and m2) then a$\ast$m1 = 1 mod m2 and hence im1 = a. and b$\ast$m2 = 1 mod m1 and hence im2 = b. Set m1 = 0$\ast$m1+1$\ast$m2 = a1$\ast$m1+b1$\ast$m2 m2 = 1$\ast$m1+0$\ast$m2 = a2$\ast$m1+b2$\ast$m2 If everything is OK, the return value is zero 

Definition at line 1466 of file reken.\+c.

\mbox{\Hypertarget{reken_8c_af384113a0d550c378c47310f17471f43}\label{reken_8c_af384113a0d550c378c47310f17471f43}} 
\index{reken.c@{reken.c}!CompCoef@{CompCoef}}
\index{CompCoef@{CompCoef}!reken.c@{reken.c}}
\doxysubsubsection{\texorpdfstring{CompCoef()}{CompCoef()}}
{\footnotesize\ttfamily W\+O\+RD Comp\+Coef (\begin{DoxyParamCaption}\item[{W\+O\+RD $\ast$}]{term1,  }\item[{W\+O\+RD $\ast$}]{term2 }\end{DoxyParamCaption})}

\begin{DoxyVerb}Routine takes a1 mod m1 and a2 mod m2 and returns a mod m1*m2 with
a mod m1 = a1 and a mod m2 = a2
\end{DoxyVerb}
 Chinese remainder\+: a\%(m1$\ast$m2) = q1$\ast$m1+a1 a\%(m1$\ast$m2) = q2$\ast$m2+a2 Compute n1 such that (n1$\ast$m1)m2 is one Compute n2 such that (n2$\ast$m2)m1 is one Then (a1$\ast$n2$\ast$m2+a2$\ast$n1$\ast$m1)\%(m1$\ast$m2) is a\%(m1$\ast$m2) 

Definition at line 3037 of file reken.\+c.

\mbox{\Hypertarget{reken_8c_ae894a9ae7aab38972d59b5f49a1ad4b1}\label{reken_8c_ae894a9ae7aab38972d59b5f49a1ad4b1}} 
\index{reken.c@{reken.c}!NextPrime@{NextPrime}}
\index{NextPrime@{NextPrime}!reken.c@{reken.c}}
\doxysubsubsection{\texorpdfstring{NextPrime()}{NextPrime()}}
{\footnotesize\ttfamily W\+O\+RD Next\+Prime (\begin{DoxyParamCaption}\item[{P\+H\+E\+AD W\+O\+RD}]{num }\end{DoxyParamCaption})}

Gives the next prime number in the list of prime numbers.

If the list isn\textquotesingle{}t long enough we expand it. For ease in Par\+Form and because these lists shouldn\textquotesingle{}t be very big we let each worker keep its own list.

The list is cut off at M\+A\+X\+P\+O\+W\+ER, because we don\textquotesingle{}t want to get into trouble that the power of a variable gets larger than the prime number. 

Definition at line 3654 of file reken.\+c.

