File: sort.tex

package info (click to toggle)
sollya 7.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 13,864 kB
  • sloc: ansic: 117,441; yacc: 8,822; lex: 2,419; makefile: 870; cpp: 76
file content (33 lines) | stat: -rw-r--r-- 1,015 bytes parent folder | download | duplicates (3)
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
\subsection{sort}
\label{labsort}
\noindent Name: \textbf{sort}\\
\phantom{aaa}sorts a list of real numbers.\\[0.2cm]
\noindent Library name:\\
\verb|   sollya_obj_t sollya_lib_sort(sollya_obj_t)|\\[0.2cm]
\noindent Usage: 
\begin{center}
\textbf{sort}(\emph{L}) : \textsf{list} $\rightarrow$ \textsf{list}\\
\end{center}
Parameters: 
\begin{itemize}
\item \emph{L} is a list.
\end{itemize}
\noindent Description: \begin{itemize}

\item If \emph{L} contains only constant values, \textbf{sort}(\emph{L}) returns the same list, but
   sorted in increasing order.

\item If \emph{L} contains at least one element that is not a constant, the command fails 
   with a type error.

\item If \emph{L} is an end-elliptic list, \textbf{sort} will fail with an error.
\end{itemize}
\noindent Example 1: 
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> sort([| |]);
[| |]
> sort([|2,3,5,2,1,4|]);
[|1, 2, 2, 3, 4, 5|]
\end{Verbatim}
\end{minipage}\end{center}
See also: \textbf{revert} (\ref{labrevert})