File: modeucl.tex

package info (click to toggle)
sollya 8.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 17,540 kB
  • sloc: ansic: 124,655; yacc: 7,543; lex: 2,440; makefile: 888; cpp: 77
file content (61 lines) | stat: -rw-r--r-- 2,074 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
\subsection{mod}
\label{labmodeucl}
\noindent Name: \textbf{mod}\\
\phantom{aaa}Computes the euclidian division of polynomials or numbers and returns the rest\\[0.2cm]
\noindent Library name:\\
\verb|   sollya_obj_t sollya_lib_euclidian_mod(sollya_obj_t, sollya_obj_t)|\\[0.2cm]
\noindent Usage: 
\begin{center}
\textbf{mod}(\emph{a}, \emph{b}) : (\textsf{function}, \textsf{function}) $\rightarrow$ \textsf{function}\\
\end{center}
Parameters: 
\begin{itemize}
\item \emph{a} is a constant or a polynomial.
\item \emph{b} is a constant or a polynomial.
\end{itemize}
\noindent Description: \begin{itemize}

\item \textbf{mod}(\emph{a},\emph{b}) computes \emph{a} \textbf{$-$} (\emph{b} \textbf{$*$} \textbf{div}(\emph{a},\emph{b})).
   In other words, it returns the remainder of the Euclidian division
   of \emph{a} by \emph{b}.

\item See \textbf{div} for subtle cases involving polynomials whose degree can
   not easily be computed by the tool as their leading coefficient is
   given as a constant expression that is mathematically zero but for
   which the tool is unable to detect this fact.
\end{itemize}
\noindent Example 1: 
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> mod(1001, 231);
77
> mod(13, 17);
13
> mod(-14, 15);
1
> mod(-213, -5);
-3
> print(mod(23/13, 11/17));
105 / 221
> print(mod(exp(13),-sin(17)));
exp(13) + 460177 * sin(17)
\end{Verbatim}
\end{minipage}\end{center}
\noindent Example 2: 
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> mod(24 + 68 * x + 74 * x^2 + 39 * x^3 + 10 * x^4 + x^5, 4 + 4 * x + x^2);
0
> mod(24 + 68 * x + 74 * x^2 + 39 * x^3 + 10 * x^4 + x^5, 2 * x^3);
24 + x * (68 + x * 74)
> mod(x^2, x^3);
x^2
\end{Verbatim}
\end{minipage}\end{center}
\noindent Example 3: 
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> mod(exp(x), x^2);
exp(x)
> mod(x^3, sin(x));
x^3
\end{Verbatim}
\end{minipage}\end{center}
See also: \textbf{gcd} (\ref{labgcd}), \textbf{div} (\ref{labdiveucl}), \textbf{bezout} (\ref{labbezout}), \textbf{numberroots} (\ref{labnumberroots})