From e7fe6c38227fa7d1a1f921d74b03bb1f8e841cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Mantelet?= Date: Tue, 18 Aug 2026 16:42:43 +0200 Subject: [PATCH 1/6] Reformat the list of math and trigo functions following what was recommended during the RFC for 2.1 by msdemlei Fixes #93 --- ADQL.tex | 404 ++++++++++++++++++++++++++++++------------------------ README.md | 2 + 2 files changed, 227 insertions(+), 179 deletions(-) diff --git a/ADQL.tex b/ADQL.tex index fe955f7..dabd593 100644 --- a/ADQL.tex +++ b/ADQL.tex @@ -36,9 +36,8 @@ \author{Alexander Szalay} \editor[http://wiki.ivoa.net/twiki/bin/view/IVOA/GregoryMantelet]{Grégory Mantelet} -\editor[http://wiki.ivoa.net/twiki/bin/view/IVOA/DaveMorris]{Dave Morris} -\previousversion[http://www.ivoa.net/Documents/ADQL/2.0]{ADQL-2.0} +\previousversion[https://www.ivoa.net/Documents/ADQL/20231215/]{ADQL-2.1} \begin{document} @@ -597,74 +596,83 @@ \subsection{Mathematical and Trigonometrical Functions} ADQL declares a list of reserved keywords \SectionSee{sec:keywords} which include the mathematical and trigonometrical function names. Their syntax, -usage and description are detailed in tables~\ref{table:math.functions} -and \ref{table:trig.functions}. +usage and description are detailed in below. -\begin{table}[tpb]\footnotesize - \begin{tabular}{|p{0.20\textwidth}|p{0.125\textwidth}|p{0.125\textwidth}|p{0.55\textwidth}|} +\subsubsection{Mathematical Functions} - \hline - \textbf{Name} & - \textbf{Argument \newline datatype} & - \textbf{Return \newline datatype} & - \textbf{Description} - \tabularnewline - - \hline - abs(x) & - \textit{x} double & - double & - Returns the absolute value of \textit{x}. - \tabularnewline +\begin{itemize} - \hline - ceiling(x) & - \textit{x} double & - double & + \item \textbf{abs(x)} + Returns the absolute value of x. + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \end{description} + \item[Return datatype] double + \end{description} + + \item \textbf{ceiling(x)} Returns the smallest integer that is not less than \textit{x}. - \tabularnewline - - \hline - degrees(x) & - \textit{x} double & - double & + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \end{description} + \item[Return datatype] double + \end{description} + + \item \textbf{degrees(x)} Converts the angle \textit{x} from radians to degrees. - \tabularnewline - - \hline - exp(x) & - \textit{x} double & - double & + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \end{description} + \item[Return datatype] double + \end{description} + + \item \textbf{exp(x)} Returns Euler’s number \textit{e} raised to the power of \textit{x}. - \tabularnewline - - \hline - floor(x) & - \textit{x} double & - double & + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \end{description} + \item[Return datatype] double + \end{description} + + \item \textbf{floor(x)} Returns the largest integer that is not greater than \textit{x}. - \tabularnewline - - \hline - log(x) & - \textit{x} double & - double & + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \end{description} + \item[Return datatype] double + \end{description} + + \item \textbf{log(x)} Returns the natural logarithm (base \textit{e}) of \textit{x}. The value of \textit{x} must be greater than zero. - \tabularnewline - - \hline - log10(x) & - \textit{x} double & - double & + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \end{description} + \item[Return datatype] double + \end{description} + + \item \textbf{log10(x)} Returns the base 10 logarithm of \textit{x}. The value of \textit{x} must be greater than zero. - \tabularnewline - - \hline - mod(x,y) & - \textit{x} double, - \newline - \textit{y} double & - double & + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \end{description} + \item[Return datatype] double + \end{description} + + \item \textbf{mod(x,y)} Returns the remainder \textit{r} of \textit{x/y} as a double, where: \begin{itemize} @@ -672,138 +680,176 @@ \subsection{Mathematical and Trigonometrical Functions} \item |\textit{r}| is less than |\textit{y}| \item \textit{x} = (\textit{f} * \textit{y}) + \textit{r} for a given integer \textit{f} \end{itemize} - \tabularnewline - - \hline - pi() & - & - double & + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \item[y] double + \end{description} + \item[Return datatype] double + \end{description} + + \item \textbf{pi()} The numeric constant \(\pi\). - \tabularnewline + \begin{description} + \item[Return datatype] double + \end{description} - \hline - power(x,y) & - \textit{x} double, - \newline - \textit{y} double & - double & + \item \textbf{power(x,y)} Returns the value of \textit{x} raised to the power of \textit{y}. - \tabularnewline - - \hline - radians(x) & - \textit{x} double & - double & + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \item[y] double + \end{description} + \item[Return datatype] double + \end{description} + + \item \textbf{radians(x)} Converts the angle \textit{x} from degrees to radians. - \tabularnewline - - \hline - sqrt(x) & - \textit{x} double & - double & + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \end{description} + \item[Return datatype] double + \end{description} + + \item \textbf{sqrt(x)} Returns the positive square root of \textit{x}. - \tabularnewline - - \hline - rand(x) & - \textit{x} double & - double & + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \end{description} + \item[Return datatype] double + \end{description} + + \item \textbf{rand(x)} Returns a random value between 0.0 and 1.0. - The optional argument, \textit{x}, originally intended to provide a random seed, - has undefined semantics. Query writers are advised to omit this argument. - \tabularnewline - - \hline - round(x,n) & - \textit{x} double, - \newline - \textit{n} integer & - double & + The optional argument, \textit{x}, originally intended to provide a + random seed, has undefined semantics. Query writers are advised to omit + this argument. + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double \textit{(optional)} + \end{description} + \item[Return datatype] double + \end{description} + + \item \textbf{round(x,n)} Rounds \textit{x} to \textit{n} decimal places. The integer \textit{n} is optional and defaults to 0 if not specified. - A negative value of \textit{n} will round to the left of the decimal point. - \tabularnewline - - \hline - truncate(x, n) & - \textit{x} double - \newline - \textit{n} integer & - double & + A negative value of \textit{n} will round to the left of the decimal + point. + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \item[n] integer \textit{(optional ; default: 0)} + \end{description} + \item[Return datatype] double + \end{description} + + \item \textbf{truncate(x,n)} Truncates \textit{x} to \textit{n} decimal places. The integer \textit{n} is optional and defaults to 0 if not specified. - \tabularnewline - \hline - \end{tabular} - \caption{Mathematical functions} - \label{table:math.functions} -\end{table} - -\begin{table}[tbh]\footnotesize - \begin{tabular}{|p{0.20\textwidth}|p{0.125\textwidth}|p{0.125\textwidth}|p{0.55\textwidth}|} - - \hline - \textbf{Name} & - \textbf{Argument \newline datatype} & - \textbf{Return \newline datatype} & - \textbf{Description} - \tabularnewline - - \hline - acos(x) & - \textit{x} double & - double & - Returns the arc cosine of \textit{x}, in the range of 0 through \(\pi\) radians. The absolute value of \textit{x} must be less than or equal to 1.0. - \tabularnewline - - \hline - asin(x) & - \textit{x} double & - double & - Returns the arc sine of \textit{x}, in the range of -\(\pi\)/2 through \(\pi\)/2 radians. The absolute value of \textit{x} must be less than or equal to 1.0. - \tabularnewline - - \hline - atan(x) & - \textit{x} double & - double & - Returns the arc tangent of \textit{x} , in the range of -\(\pi\)/2 through \(\pi\)/2 radians. - \tabularnewline - - \hline - atan2(y,x) & - \textit{x} double, - \newline - \textit{y} double & - double & - Converts rectangular coordinates \textit{x,y} to polar angle. It computes the arc tangent of \textit{y/x} in the range of –\(\pi\) through \(\pi\) radians. - \tabularnewline + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \item[n] integer \textit{(optional ; default: 0)} + \end{description} + \item[Return datatype] double + \end{description} +\end{itemize} - \hline - cos(x) & - \textit{x} double & - double & - Returns the cosine of the angle \textit{x} in radians, in the range of -1.0 through 1.0. - \tabularnewline +\subsubsection{Trigonometrical Functions} - \hline - sin(x) & - \textit{x} double & - double & - Returns the sine of the angle \textit{x} in radians, in the range of -1.0 through 1.0. - \tabularnewline +\begin{itemize} - \hline - tan(x) & - \textit{x} double & - double & + \item \textbf{acos(x)} + Returns the arc cosine of \textit{x}, in the range of 0 through + \(\pi\) radians. The absolute value of \textit{x} must be less than or + equal to 1.0. + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \end{description} + \item[Return datatype] double + \end{description} + + \item \textbf{asin(x)} + Returns the arc sine of \textit{x}, in the range of -\(\pi\)/2 through + \(\pi\)/2 radians. The absolute value of \textit{x} must be less than or + equal to 1.0. + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \end{description} + \item[Return datatype] double + \end{description} + + \item \textbf{atan(x)} + Returns the arc tangent of \textit{x} , in the range of -\(\pi\)/2 + through \(\pi\)/2 radians. + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \end{description} + \item[Return datatype] double + \end{description} + + \item \textbf{atan2(x,y)} + Converts rectangular coordinates \textit{x,y} to polar angle. It + computes the arc tangent of \textit{y/x} in the range of –\(\pi\) + through \(\pi\) radians. + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \item[y] double + \end{description} + \item[Return datatype] double + \end{description} + + \item \textbf{cos(x)} + Returns the cosine of the angle \textit{x} in radians, in the range of + -1.0 through 1.0. + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \end{description} + \item[Return datatype] double + \end{description} + + \item \textbf{sin(x)} + Returns the sine of the angle \textit{x} in radians, in the range of + -1.0 through 1.0. + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \end{description} + \item[Return datatype] double + \end{description} + + \item \textbf{tan(x)} Returns the tangent of the angle \textit{x} in radians. - \tabularnewline - \hline - \end{tabular} - \caption{Trigonometrical functions} - \label{table:trig.functions} -\end{table} + \begin{description} + \item[Arguments]: + \begin{description} + \item[x] double + \end{description} + \item[Return datatype] double + \end{description} +\end{itemize} \section{Type system} \label{sec:types} diff --git a/README.md b/README.md index c3322aa..004a055 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ specific to astronomy. ## Status? +_**The version presently available in this repository is WD-2.2.**_ + The last stable version is **[REC-2.1](http://www.ivoa.net/documents/latest/ADQL.html)**. From e897f53e6d9a2b479da7c4181d5c1701e49cd764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Mantelet?= Date: Wed, 19 Aug 2026 10:41:38 +0200 Subject: [PATCH 2/6] Update the change log --- ADQL.tex | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ADQL.tex b/ADQL.tex index dabd593..2f206ad 100644 --- a/ADQL.tex +++ b/ADQL.tex @@ -2977,6 +2977,14 @@ \subsection{Between 2.1 and 2.2} \begin{itemize} \item Erratum 1 - Addition of auxiliary files for the BNF grammar \end{itemize} + \item \textbf{General} + \begin{itemize} + \item \textbf{Updated} + \begin{itemize} + \item Convert the tables for mathematical and trigonometrical + functions into lists (see \SectionRef{sec:math.functions}) + \end{itemize} + \end{itemize} \end{itemize} \subsection{Between 2.0 and 2.1} From afbdef8ff87bbc2250f509b699f9a06ad5048267 Mon Sep 17 00:00:00 2001 From: Mark Taylor Date: Tue, 25 Aug 2026 09:38:34 +0100 Subject: [PATCH 3/6] Move colons inside \item arguments I replaced \item[Arguments]: -> \item[Arguments:] throughout the changes; the existing formulation put the colons in a funny place in the HTML output. --- ADQL.tex | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/ADQL.tex b/ADQL.tex index 2f206ad..7338892 100644 --- a/ADQL.tex +++ b/ADQL.tex @@ -605,7 +605,7 @@ \subsubsection{Mathematical Functions} \item \textbf{abs(x)} Returns the absolute value of x. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \end{description} @@ -615,7 +615,7 @@ \subsubsection{Mathematical Functions} \item \textbf{ceiling(x)} Returns the smallest integer that is not less than \textit{x}. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \end{description} @@ -625,7 +625,7 @@ \subsubsection{Mathematical Functions} \item \textbf{degrees(x)} Converts the angle \textit{x} from radians to degrees. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \end{description} @@ -635,7 +635,7 @@ \subsubsection{Mathematical Functions} \item \textbf{exp(x)} Returns Euler’s number \textit{e} raised to the power of \textit{x}. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \end{description} @@ -645,7 +645,7 @@ \subsubsection{Mathematical Functions} \item \textbf{floor(x)} Returns the largest integer that is not greater than \textit{x}. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \end{description} @@ -655,7 +655,7 @@ \subsubsection{Mathematical Functions} \item \textbf{log(x)} Returns the natural logarithm (base \textit{e}) of \textit{x}. The value of \textit{x} must be greater than zero. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \end{description} @@ -665,7 +665,7 @@ \subsubsection{Mathematical Functions} \item \textbf{log10(x)} Returns the base 10 logarithm of \textit{x}. The value of \textit{x} must be greater than zero. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \end{description} @@ -681,7 +681,7 @@ \subsubsection{Mathematical Functions} \item \textit{x} = (\textit{f} * \textit{y}) + \textit{r} for a given integer \textit{f} \end{itemize} \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \item[y] double @@ -698,7 +698,7 @@ \subsubsection{Mathematical Functions} \item \textbf{power(x,y)} Returns the value of \textit{x} raised to the power of \textit{y}. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \item[y] double @@ -709,7 +709,7 @@ \subsubsection{Mathematical Functions} \item \textbf{radians(x)} Converts the angle \textit{x} from degrees to radians. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \end{description} @@ -719,7 +719,7 @@ \subsubsection{Mathematical Functions} \item \textbf{sqrt(x)} Returns the positive square root of \textit{x}. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \end{description} @@ -732,7 +732,7 @@ \subsubsection{Mathematical Functions} random seed, has undefined semantics. Query writers are advised to omit this argument. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \textit{(optional)} \end{description} @@ -745,7 +745,7 @@ \subsubsection{Mathematical Functions} A negative value of \textit{n} will round to the left of the decimal point. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \item[n] integer \textit{(optional ; default: 0)} @@ -757,7 +757,7 @@ \subsubsection{Mathematical Functions} Truncates \textit{x} to \textit{n} decimal places. The integer \textit{n} is optional and defaults to 0 if not specified. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \item[n] integer \textit{(optional ; default: 0)} @@ -775,7 +775,7 @@ \subsubsection{Trigonometrical Functions} \(\pi\) radians. The absolute value of \textit{x} must be less than or equal to 1.0. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \end{description} @@ -787,7 +787,7 @@ \subsubsection{Trigonometrical Functions} \(\pi\)/2 radians. The absolute value of \textit{x} must be less than or equal to 1.0. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \end{description} @@ -798,7 +798,7 @@ \subsubsection{Trigonometrical Functions} Returns the arc tangent of \textit{x} , in the range of -\(\pi\)/2 through \(\pi\)/2 radians. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \end{description} @@ -810,7 +810,7 @@ \subsubsection{Trigonometrical Functions} computes the arc tangent of \textit{y/x} in the range of –\(\pi\) through \(\pi\) radians. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \item[y] double @@ -822,7 +822,7 @@ \subsubsection{Trigonometrical Functions} Returns the cosine of the angle \textit{x} in radians, in the range of -1.0 through 1.0. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \end{description} @@ -833,7 +833,7 @@ \subsubsection{Trigonometrical Functions} Returns the sine of the angle \textit{x} in radians, in the range of -1.0 through 1.0. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \end{description} @@ -843,7 +843,7 @@ \subsubsection{Trigonometrical Functions} \item \textbf{tan(x)} Returns the tangent of the angle \textit{x} in radians. \begin{description} - \item[Arguments]: + \item[Arguments:] \begin{description} \item[x] double \end{description} From 2f98137062a12951e980f73b01326a3a3b2a22f7 Mon Sep 17 00:00:00 2001 From: Mark Taylor Date: Tue, 25 Aug 2026 10:58:49 +0100 Subject: [PATCH 4/6] Fix ugly HTML arg formatting from last commit --- ADQL.tex | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/ADQL.tex b/ADQL.tex index 7338892..d5e8521 100644 --- a/ADQL.tex +++ b/ADQL.tex @@ -605,7 +605,7 @@ \subsubsection{Mathematical Functions} \item \textbf{abs(x)} Returns the absolute value of x. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \end{description} @@ -615,7 +615,7 @@ \subsubsection{Mathematical Functions} \item \textbf{ceiling(x)} Returns the smallest integer that is not less than \textit{x}. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \end{description} @@ -625,7 +625,7 @@ \subsubsection{Mathematical Functions} \item \textbf{degrees(x)} Converts the angle \textit{x} from radians to degrees. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \end{description} @@ -635,7 +635,7 @@ \subsubsection{Mathematical Functions} \item \textbf{exp(x)} Returns Euler’s number \textit{e} raised to the power of \textit{x}. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \end{description} @@ -645,7 +645,7 @@ \subsubsection{Mathematical Functions} \item \textbf{floor(x)} Returns the largest integer that is not greater than \textit{x}. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \end{description} @@ -655,7 +655,7 @@ \subsubsection{Mathematical Functions} \item \textbf{log(x)} Returns the natural logarithm (base \textit{e}) of \textit{x}. The value of \textit{x} must be greater than zero. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \end{description} @@ -665,7 +665,7 @@ \subsubsection{Mathematical Functions} \item \textbf{log10(x)} Returns the base 10 logarithm of \textit{x}. The value of \textit{x} must be greater than zero. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \end{description} @@ -681,7 +681,7 @@ \subsubsection{Mathematical Functions} \item \textit{x} = (\textit{f} * \textit{y}) + \textit{r} for a given integer \textit{f} \end{itemize} \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \item[y] double @@ -698,7 +698,7 @@ \subsubsection{Mathematical Functions} \item \textbf{power(x,y)} Returns the value of \textit{x} raised to the power of \textit{y}. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \item[y] double @@ -709,7 +709,7 @@ \subsubsection{Mathematical Functions} \item \textbf{radians(x)} Converts the angle \textit{x} from degrees to radians. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \end{description} @@ -719,7 +719,7 @@ \subsubsection{Mathematical Functions} \item \textbf{sqrt(x)} Returns the positive square root of \textit{x}. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \end{description} @@ -732,7 +732,7 @@ \subsubsection{Mathematical Functions} random seed, has undefined semantics. Query writers are advised to omit this argument. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \textit{(optional)} \end{description} @@ -745,7 +745,7 @@ \subsubsection{Mathematical Functions} A negative value of \textit{n} will round to the left of the decimal point. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \item[n] integer \textit{(optional ; default: 0)} @@ -757,7 +757,7 @@ \subsubsection{Mathematical Functions} Truncates \textit{x} to \textit{n} decimal places. The integer \textit{n} is optional and defaults to 0 if not specified. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \item[n] integer \textit{(optional ; default: 0)} @@ -775,7 +775,7 @@ \subsubsection{Trigonometrical Functions} \(\pi\) radians. The absolute value of \textit{x} must be less than or equal to 1.0. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \end{description} @@ -787,7 +787,7 @@ \subsubsection{Trigonometrical Functions} \(\pi\)/2 radians. The absolute value of \textit{x} must be less than or equal to 1.0. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \end{description} @@ -798,7 +798,7 @@ \subsubsection{Trigonometrical Functions} Returns the arc tangent of \textit{x} , in the range of -\(\pi\)/2 through \(\pi\)/2 radians. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \end{description} @@ -810,7 +810,7 @@ \subsubsection{Trigonometrical Functions} computes the arc tangent of \textit{y/x} in the range of –\(\pi\) through \(\pi\) radians. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \item[y] double @@ -822,7 +822,7 @@ \subsubsection{Trigonometrical Functions} Returns the cosine of the angle \textit{x} in radians, in the range of -1.0 through 1.0. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \end{description} @@ -833,7 +833,7 @@ \subsubsection{Trigonometrical Functions} Returns the sine of the angle \textit{x} in radians, in the range of -1.0 through 1.0. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \end{description} @@ -843,7 +843,7 @@ \subsubsection{Trigonometrical Functions} \item \textbf{tan(x)} Returns the tangent of the angle \textit{x} in radians. \begin{description} - \item[Arguments:] + \item[Arguments:]\mbox{} \begin{description} \item[x] double \end{description} From 7d5b5a8a103c331ec100ee4d54f6579e99f50cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Mantelet?= Date: Fri, 25 Sep 2026 15:32:33 +0200 Subject: [PATCH 5/6] A more compact way to present math and trigo functions --- ADQL.tex | 359 ++++++++++++++++++------------------------------------- 1 file changed, 114 insertions(+), 245 deletions(-) diff --git a/ADQL.tex b/ADQL.tex index d5e8521..0c9f2a9 100644 --- a/ADQL.tex +++ b/ADQL.tex @@ -14,6 +14,10 @@ \usepackage{hyperref} +% Redefine description blocks so that the definition is always on a new line instead of being just after the label: +\usepackage{enumitem} \SetLabelAlign{parleft}{\parbox[t]\textwidth{#1}} +\setdescription{ align=parleft, style=nextline } + % Macros for referring to IVOA standards and notes. \input{ivoa-cite.tex} @@ -600,256 +604,121 @@ \subsection{Mathematical and Trigonometrical Functions} \subsubsection{Mathematical Functions} -\begin{itemize} - - \item \textbf{abs(x)} - Returns the absolute value of x. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \end{description} - \item[Return datatype] double - \end{description} - - \item \textbf{ceiling(x)} - Returns the smallest integer that is not less than \textit{x}. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \end{description} - \item[Return datatype] double - \end{description} - - \item \textbf{degrees(x)} - Converts the angle \textit{x} from radians to degrees. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \end{description} - \item[Return datatype] double - \end{description} - - \item \textbf{exp(x)} - Returns Euler’s number \textit{e} raised to the power of \textit{x}. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \end{description} - \item[Return datatype] double - \end{description} - - \item \textbf{floor(x)} - Returns the largest integer that is not greater than \textit{x}. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \end{description} - \item[Return datatype] double - \end{description} - - \item \textbf{log(x)} - Returns the natural logarithm (base \textit{e}) of \textit{x}. The value of \textit{x} must be greater than zero. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \end{description} - \item[Return datatype] double - \end{description} - - \item \textbf{log10(x)} - Returns the base 10 logarithm of \textit{x}. The value of \textit{x} must be greater than zero. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \end{description} - \item[Return datatype] double - \end{description} - - \item \textbf{mod(x,y)} - Returns the remainder \textit{r} of \textit{x/y} as a double, - where: - \begin{itemize} - \item \textit{r} has the same sign as \textit{x} +\begin{description} + \item[\texttt{abs(x)}] + \texttt{double abs(double x)} \\ + Returns the absolute value of x. + + \item[\texttt{ceiling(x)}] + \texttt{double ceiling(double x)} \\ + Returns the smallest integer that is not less than \textit{x}. + + \item[\texttt{degrees(x)}] + \texttt{double degrees(double x)} \\ + Converts the angle \textit{x} from radians to degrees. + + \item[\texttt{exp(x)}] + \texttt{double exp(double x)} \\ + Returns Euler’s number \textit{e} raised to the power of \textit{x}. + + \item[\texttt{floor(x)}] + \texttt{double floor(double x)} \\ + Returns the largest integer that is not greater than \textit{x}. + + \item[\texttt{log(x)}] + \texttt{double log(double x)} \\ + Returns the natural logarithm (base \textit{e}) of \textit{x}. The value of \textit{x} must be greater than zero. + + \item[\texttt{log10(x)}] + \texttt{double log10(double x)} \\ + Returns the base 10 logarithm of \textit{x}. The value of \textit{x} must be greater than zero. + + \item[\texttt{mod(x,y)}] + \texttt{double mod(double x, double y)} \\ + Returns the remainder \textit{r} of \textit{x/y} as a double, + where: + \begin{itemize} + \item \textit{r} has the same sign as \textit{x} \item |\textit{r}| is less than |\textit{y}| \item \textit{x} = (\textit{f} * \textit{y}) + \textit{r} for a given integer \textit{f} - \end{itemize} - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \item[y] double - \end{description} - \item[Return datatype] double - \end{description} - - \item \textbf{pi()} - The numeric constant \(\pi\). - \begin{description} - \item[Return datatype] double - \end{description} - - \item \textbf{power(x,y)} - Returns the value of \textit{x} raised to the power of \textit{y}. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \item[y] double - \end{description} - \item[Return datatype] double - \end{description} - - \item \textbf{radians(x)} - Converts the angle \textit{x} from degrees to radians. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \end{description} - \item[Return datatype] double - \end{description} - - \item \textbf{sqrt(x)} - Returns the positive square root of \textit{x}. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \end{description} - \item[Return datatype] double - \end{description} - - \item \textbf{rand(x)} - Returns a random value between 0.0 and 1.0. - The optional argument, \textit{x}, originally intended to provide a - random seed, has undefined semantics. Query writers are advised to omit - this argument. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double \textit{(optional)} - \end{description} - \item[Return datatype] double - \end{description} - - \item \textbf{round(x,n)} - Rounds \textit{x} to \textit{n} decimal places. - The integer \textit{n} is optional and defaults to 0 if not specified. - A negative value of \textit{n} will round to the left of the decimal - point. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \item[n] integer \textit{(optional ; default: 0)} - \end{description} - \item[Return datatype] double - \end{description} - - \item \textbf{truncate(x,n)} - Truncates \textit{x} to \textit{n} decimal places. - The integer \textit{n} is optional and defaults to 0 if not specified. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \item[n] integer \textit{(optional ; default: 0)} - \end{description} - \item[Return datatype] double - \end{description} -\end{itemize} + \end{itemize} + + \item[\texttt{pi()}] + \texttt{double pi()} \\ + The numeric constant \(\pi\). + + \item[\texttt{power(x,y)}] + \texttt{double power(double x, double y)} \\ + Returns the value of \textit{x} raised to the power of \textit{y}. + + \item[\texttt{radians(x)}] + \texttt{double radians(double x)} \\ + Converts the angle \textit{x} from degrees to radians. + + \item[\texttt{sqrt(x)}] + \texttt{double sqrt(double x)} \\ + Returns the positive square root of \textit{x}. + + \item[\texttt{rand(x)}] + \texttt{double rand(double x)} \\ + Returns a random value between 0.0 and 1.0. + The optional argument, \textit{x}, originally intended to provide a + random seed, has undefined semantics. Query writers are advised to omit + this argument. + + \item[\texttt{round(x,n)}] + \texttt{double round(double x, integer n)} \\ + Rounds \textit{x} to \textit{n} decimal places. + The integer \textit{n} is optional and defaults to 0 if not specified. + A negative value of \textit{n} will round to the left of the decimal + point. + + \item[\texttt{truncate(x, n)}] + \texttt{double truncate(double x, integer n)} \\ + Truncates \textit{x} to \textit{n} decimal places. + The integer \textit{n} is optional and defaults to 0 if not specified. +\end{description} \subsubsection{Trigonometrical Functions} -\begin{itemize} - - \item \textbf{acos(x)} - Returns the arc cosine of \textit{x}, in the range of 0 through - \(\pi\) radians. The absolute value of \textit{x} must be less than or - equal to 1.0. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \end{description} - \item[Return datatype] double - \end{description} - - \item \textbf{asin(x)} - Returns the arc sine of \textit{x}, in the range of -\(\pi\)/2 through - \(\pi\)/2 radians. The absolute value of \textit{x} must be less than or - equal to 1.0. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \end{description} - \item[Return datatype] double - \end{description} - - \item \textbf{atan(x)} - Returns the arc tangent of \textit{x} , in the range of -\(\pi\)/2 - through \(\pi\)/2 radians. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \end{description} - \item[Return datatype] double - \end{description} - - \item \textbf{atan2(x,y)} - Converts rectangular coordinates \textit{x,y} to polar angle. It - computes the arc tangent of \textit{y/x} in the range of –\(\pi\) - through \(\pi\) radians. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \item[y] double - \end{description} - \item[Return datatype] double - \end{description} - - \item \textbf{cos(x)} - Returns the cosine of the angle \textit{x} in radians, in the range of - -1.0 through 1.0. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \end{description} - \item[Return datatype] double - \end{description} - - \item \textbf{sin(x)} - Returns the sine of the angle \textit{x} in radians, in the range of - -1.0 through 1.0. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \end{description} - \item[Return datatype] double - \end{description} - - \item \textbf{tan(x)} - Returns the tangent of the angle \textit{x} in radians. - \begin{description} - \item[Arguments:]\mbox{} - \begin{description} - \item[x] double - \end{description} - \item[Return datatype] double - \end{description} -\end{itemize} +\begin{description} + \item[\texttt{acos(x)}] + \texttt{double acos(double x)} \\ + Returns the arc cosine of \textit{x}, in the range of 0 through + \(\pi\) radians. The absolute value of \textit{x} must be less than or + equal to 1.0. + + \item[\texttt{asin(x)}] + \texttt{double asin(double x)} \\ + Returns the arc sine of \textit{x}, in the range of -\(\pi\)/2 through + \(\pi\)/2 radians. The absolute value of \textit{x} must be less than or + equal to 1.0. + + \item[\texttt{atan(x)}] + \texttt{double atan(double x)} \\ + Returns the arc tangent of \textit{x} , in the range of -\(\pi\)/2 + through \(\pi\)/2 radians. + + \item[\texttt{atan2(y,x)}] + \texttt{double atan2(double y, double x)} \\ + Converts rectangular coordinates \textit{x,y} to polar angle. It + computes the arc tangent of \textit{y/x} in the range of –\(\pi\) + through \(\pi\) radians. + + \item[\texttt{cos(x)}] + \texttt{double cos(double x)} \\ + Returns the cosine of the angle \textit{x} in radians, in the range of + -1.0 through 1.0. + + \item[\texttt{sin(x)}] + \texttt{double sin(double x)} \\ + Returns the sine of the angle \textit{x} in radians, in the range of + -1.0 through 1.0. + + \item[\texttt{tan(x)}] + \texttt{double tan(double x)} \\ + Returns the tangent of the angle \textit{x} in radians. +\end{description} \section{Type system} \label{sec:types} From 80ceaa0c44e94d715cea15b3554fe305096a3e4b Mon Sep 17 00:00:00 2001 From: Mark Taylor Date: Fri, 25 Sep 2026 15:12:43 +0100 Subject: [PATCH 6/6] Fix HTML formatting error for mod(x,y) definition The text "|\textit{r}| is less than |\textit{y}|" rendered OK in the PDF, but in the HTML came out as the incomprehensible/wrong "- r - is less than - y -". This is not new, it was in ADQL 2.1 as well, but might as well fix it here. --- ADQL.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ADQL.tex b/ADQL.tex index 0c9f2a9..4a96bcf 100644 --- a/ADQL.tex +++ b/ADQL.tex @@ -639,7 +639,7 @@ \subsubsection{Mathematical Functions} where: \begin{itemize} \item \textit{r} has the same sign as \textit{x} - \item |\textit{r}| is less than |\textit{y}| + \item \textit{$|r|$} is less than \textit{$|y|$} \item \textit{x} = (\textit{f} * \textit{y}) + \textit{r} for a given integer \textit{f} \end{itemize}