Changeset fbfde843 for doc/user/user.tex


Ignore:
Timestamp:
May 2, 2016, 3:15:07 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
d7903b1
Parents:
540de412 (diff), e945826 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into ctor

Conflicts:

src/libcfa/fstream.c
src/libcfa/iostream.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/user/user.tex

    r540de412 rfbfde843  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Thu Apr 21 08:15:37 2016
    14 %% Update Count     : 131
     13%% Last Modified On : Sat Apr 30 13:54:32 2016
     14%% Update Count     : 221
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
    1717% requires tex packages: texlive-base texlive-latex-base tex-common texlive-humanities texlive-latex-extra texlive-fonts-recommended
     18
     19% red highlighting ®...® (registered trademark sumbol)
     20% blue highlighting ©...© (copyright symbol)
     21% latex escape §...§ (section symbol)
     22% keyword escape ¶...¶ (pilcrow symbol)
     23% math escape $...$ (dollar symbol)
    1824
    1925\documentclass[openright,twoside]{article}
     
    226232
    227233
    228 \section{Compiling \CFA Program}
     234\section[Compiling CFA Program]{Compiling \CFA Program}
    229235
    230236The command \lstinline@cfa@ is used to compile \CFA program(s).
    231237This command works like the GNU \lstinline@gcc@\index{gcc} command, e.g.:
    232238\begin{lstlisting}
    233 cfa [ gcc-options ] C/@{\CFA}@-files [ assembler/loader-files ]
    234 \end{lstlisting}
    235 \index{cfa@\lstinline$cfa$}\index{compilation!cfa@\lstinline$cfa$}
     239cfa [ gcc-options ] C/§\CFA§-files [ assembler/loader-files ]
     240\end{lstlisting}
     241\indexc{cfa}\index{compilation!cfa@\lstinline$cfa$}
    236242By default, \CFA programs having the following \lstinline@gcc@ flags turned on:
    237243\begin{description}
    238 \item
    239 \hspace*{-4pt}\lstinline@-std=gnu99@
    240 \index{-std=gnu99@{\lstinline$-std=gnu99$}}\index{compilation option!-std=gnu99@{\lstinline$-std=gnu99$}}
     244\item\hspace*{-4pt}\Indexc{-std=gnu99}\index{compilation option!-std=gnu99@{\lstinline$-std=gnu99$}}
    241245The 1999 C standard plus GNU extensions.
    242 \item
    243 \hspace*{-4pt}\lstinline@-fgnu89-inline@
    244 \index{-fgnu89-inline@{\lstinline$-fgnu89-inline$}}\index{compilation option!-fgnu89-inline@{\lstinline$-fgnu89-inline$}}
     246\item\hspace*{-4pt}\Indexc{-fgnu89-¶inline¶}\index{compilation option!-fgnu89-inline@{\lstinline$-fgnu89-¶inline¶$}}
    245247Use the traditional GNU semantics for inline routines in C99 mode.
    246248\end{description}
    247249The following new \CFA option is available:
    248250\begin{description}
    249 \item
    250 \hspace*{-4pt}\lstinline@-CFA@
    251 \index{-CFA@{\lstinline$-CFA$}}\index{compilation option!-CFA@{\lstinline$-CFA$}}
     251\item\hspace*{-4pt}\Indexc{-CFA}\index{compilation option!-CFA@{\lstinline$-CFA$}}
    252252Only the C preprocessor and the \CFA translator steps are performed and the transformed program is written to standard output, which makes it possible to examine the code generated by the \CFA translator.
    253253\end{description}
     
    255255The following preprocessor variables are available:
    256256\begin{description}
    257 \item
    258 \hspace*{-4pt}\lstinline$__CFA__$
    259 \index{__CFA__@{\lstinline$__CFA__$}}\index{preprocessor variables!__CFA__@{\lstinline$__CFA__$}}
     257\item\hspace*{-4pt}\Indexc{__CFA__}\index{preprocessor variables!__CFA__@{\lstinline$__CFA__$}}
    260258is always available during preprocessing and its value is the current major \Index{version number} of \CFA.\footnote{
    261259The C preprocessor allows only integer values in a preprocessor variable so a value like ``\Version'' is not allowed.
    262260Hence, the need to have three variables for the major, minor and patch version number.}
    263261
    264 \item
    265 \hspace*{-4pt}\lstinline$__CFA_MINOR__$
    266 \index{__CFA_MINOR__@{\lstinline$__CFA_MINOR__$}}\index{preprocessor variables!__CFA_MINOR__@{\lstinline$__CFA_MINOR__$}}
     262\item\hspace*{-4pt}\Indexc{__CFA_MINOR__}\index{preprocessor variables!__CFA_MINOR__@{\lstinline$__CFA_MINOR__$}}
    267263is always available during preprocessing and its value is the current minor \Index{version number} of \CFA.
    268264
    269 \item
    270 \hspace*{-4pt}\lstinline$__CFA_PATCH__$
    271 \index{__CFA_PATCH__@%(__CFA_PATCH__%)}\index{preprocessor variables!__CFA_PATCH__@%(__CFA_PATCH__%)}
     265\item\hspace*{-4pt}\Indexc{__CFA_PATCH__}\index{preprocessor variables!__CFA_PATCH__@\lstinline$__CFA_PATCH__$}
    272266is always available during preprocessing and its value is the current patch \Index{version number} of \CFA.
    273267
    274 \item
    275 \hspace*{-4pt}\lstinline$__CFORALL__$
    276 \index{__CFORALL__@%(__CFORALL__%)}\index{preprocessor variables!__CFORALL__@%(__CFORALL__%)}
     268\item\hspace*{-4pt}\Indexc{__CFORALL__}\index{preprocessor variables!__CFORALL__@\lstinline$__CFORALL__$}
    277269is always available during preprocessing and it has no value.
    278270\end{description}
     
    282274\begin{lstlisting}
    283275#ifndef __CFORALL__
    284 #include <stdio.h>              // C header file
     276#include <stdio.h>                      // C header file
    285277#else
    286 #include <fstream>              // @\CFA{}@ header file
     278#include <fstream>                      // §\CFA{}§ header file
    287279#endif
    288280\end{lstlisting}
     
    294286Numeric constants are extended to allow \Index{underscore}s within constants\index{constant!underscore}, e.g.:
    295287\begin{lstlisting}
    296 2`_`147`_`483`_`648;                            // decimal constant
     2882®_®147®_®483®_®648;                            // decimal constant
    29728956_ul;                                          // decimal unsigned long constant
    2982900_377;                                          // octal constant
     
    360352\multicolumn{1}{c@{\hspace{30pt}}}{\textbf{\CFA}}       & \multicolumn{1}{c}{\textbf{C}}        \\
    361353\begin{lstlisting}
    362 `* int x, y;`
     354®* int x, y;®
    363355\end{lstlisting}
    364356&
     
    488480The point of the new syntax is to allow returning multiple values from a routine~\cite{CLU,Galletly96}, e.g.:
    489481\begin{lstlisting}
    490 `[ int o1, int o2, char o3 ]` f( int i1, char i2, char i3 ) {
    491         @\emph{routine body}@
     482®[ int o1, int o2, char o3 ]® f( int i1, char i2, char i3 ) {
     483        §\emph{routine body}§
    492484}
    493485\end{lstlisting}
     
    500492Declaration qualifiers can only appear at the start of a routine definition, e.g.:
    501493\begin{lstlisting}
    502 extern [ int x ] g( int y ) {@\,@}
     494extern [ int x ] g( int y ) {§\,§}
    503495\end{lstlisting}
    504496Lastly, if there are no output parameters or input parameters, the brackets and/or parentheses must still be specified;
    505497in both cases the type is assumed to be void as opposed to old style C defaults of int return type and unknown parameter types, respectively, as in:
    506498\begin{lstlisting}
    507 [@\,@] g(@\,@);                         // no input or output parameters
     499[§\,§] g();                                             // no input or output parameters
    508500[ void ] g( void );                     // no input or output parameters
    509501\end{lstlisting}
     
    556548Because the value in the return variable is automatically returned when a \CFA routine terminates, the \lstinline@return@ statement \emph{does not} contain an expression, as in:
    557549\begin{lstlisting}
    558 `[ int x ]` f() {
     550®[ int x ]® f() {
    559551        ... x = 0; ... x = y; ...
    560         `return;` // implicitly return x
     552        ®return;® // implicitly return x
    561553}
    562554\end{lstlisting}
     
    781773\subsection{Type Nesting}
    782774
    783 \CFA allows \Index{type nesting}, and type qualification of the nested types, where as C hoists\index{type!hoisting} (refactors) nested types into the enclosing scope and has no type qualification.
     775\CFA allows \Index{type nesting}, and type qualification of the nested types, where as C hoists\index{type hoisting} (refactors) nested types into the enclosing scope and has no type qualification.
    784776\begin{quote2}
    785777\begin{tabular}{@{}l@{\hspace{30pt}}l|l@{}}
     
    836828
    837829int fred() {
    838         s.t.c = `S.`R;  // type qualification
    839         struct `S.`T t = { `S.`R, 1, 2 };
    840         enum `S.`C c;
    841         union `S.T.`U u;
     830        s.t.c = ®S.®R;  // type qualification
     831        struct ®S.®T t = { ®S.®R, 1, 2 };
     832        enum ®S.®C c;
     833        union ®S.T.®U u;
    842834}
    843835\end{lstlisting}
     
    863855qsort( ia, size );              // sort ascending order using builtin ?<?
    864856{
    865         `int ?<?( int x, int y ) { return x > y; }` // nested routine
     857        ®int ?<?( int x, int y ) { return x > y; }® // nested routine
    866858        qsort( ia, size );      // sort descending order by local redefinition
    867859}
     
    873865\begin{lstlisting}
    874866[* [int]( int )] foo() {                // int (*foo())( int )
    875         int `i` = 7;
     867        int ®i® = 7;
    876868        int bar( int p ) {
    877                 `i` += 1;                                       // dependent on local variable
    878                 sout | `i` | endl;
     869                ®i® += 1;                                       // dependent on local variable
     870                sout | ®i® | endl;
    879871        }
    880872        return bar;                                     // undefined because of local dependence
     
    897889The general syntax of a tuple is:
    898890\begin{lstlisting}
    899 [ $\emph{exprlist}$ ]
     891[ §\emph{exprlist}§ ]
    900892\end{lstlisting}
    901893where \lstinline@$\emph{exprlist}$@ is a list of one or more expressions separated by commas.
     
    917909The general syntax of a tuple type is:
    918910\begin{lstlisting}
    919 [ @\emph{typelist}@ ]
     911[ §\emph{typelist}§ ]
    920912\end{lstlisting}
    921913where \lstinline@$\emph{typelist}$@ is a list of one or more legal \CFA or C type specifications separated by commas, which may include other tuple type specifications.
     
    10471039Mass assignment has the following form:
    10481040\begin{lstlisting}
    1049 [ @\emph{lvalue}@, ..., @\emph{lvalue}@ ] = @\emph{expr}@;
    1050 \end{lstlisting}
    1051 The left-hand side is a tuple of \lstinline@$\emph{lvalues}$@, which is a list of expressions each yielding an address, i.e., any data object that can appear on the left-hand side of a conventional assignment statement.
     1041[ §\emph{lvalue}§, ..., §\emph{lvalue}§ ] = §\emph{expr}§;
     1042\end{lstlisting}
     1043The left-hand side is a tuple of \emph{lvalues}, which is a list of expressions each yielding an address, i.e., any data object that can appear on the left-hand side of a conventional assignment statement.
    10521044\lstinline@$\emph{expr}$@ is any standard arithmetic expression.
    10531045Clearly, the types of the entities being assigned must be type compatible with the value of the expression.
     
    10861078Multiple assignment has the following form:
    10871079\begin{lstlisting}
    1088 [ @\emph{lvalue}@, . . ., @\emph{lvalue}@ ] = [ @\emph{expr}@, . . ., @\emph{expr}@ ];
    1089 \end{lstlisting}
    1090 The left-hand side is a tuple of \lstinline@$\emph{lvalues}$@, and the right-hand side is a tuple of \lstinline@$\emph{expr}$@s.
    1091 Each \lstinline@$\emph{expr}$@ appearing on the righthand side of a multiple assignment statement is assigned to the corresponding \lstinline@$\emph{lvalues}$@ on the left-hand side of the statement using parallel semantics for each assignment.
     1080[ §\emph{lvalue}§, . . ., §\emph{lvalue}§ ] = [ §\emph{expr}§, . . ., §\emph{expr}§ ];
     1081\end{lstlisting}
     1082The left-hand side is a tuple of \emph{lvalues}, and the right-hand side is a tuple of \emph{expr}s.
     1083Each \emph{expr} appearing on the righthand side of a multiple assignment statement is assigned to the corresponding \emph{lvalues} on the left-hand side of the statement using parallel semantics for each assignment.
    10921084An example of multiple assignment is:
    10931085\begin{lstlisting}
     
    11261118Cascade assignment has the following form:
    11271119\begin{lstlisting}
    1128 @\emph{tuple}@ = @\emph{tuple}@ = ... = @\emph{tuple}@;
     1120§\emph{tuple}§ = §\emph{tuple}§ = ... = §\emph{tuple}§;
    11291121\end{lstlisting}
    11301122and it has the same parallel semantics as for mass and multiple assignment.
     
    11441136Its general form is:
    11451137\begin{lstlisting}
    1146 @\emph{expr}@ . [ @\emph{fieldlist}@ ]
    1147 @\emph{expr}@ -> [ @\emph{fieldlist}@ ]
    1148 \end{lstlisting}
    1149 \lstinline@$\emph{expr}$@ is any expression yielding a value of type record, e.g., \lstinline@struct@, \lstinline@union@.
    1150 Each element of \lstinline@$\emph{ fieldlist}$@ is an element of the record specified by \lstinline@$\emph{expr}$@.
     1138§\emph{expr}§ . [ §\emph{fieldlist}§ ]
     1139§\emph{expr}§ -> [ §\emph{fieldlist}§ ]
     1140\end{lstlisting}
     1141\emph{expr} is any expression yielding a value of type record, e.g., \lstinline@struct@, \lstinline@union@.
     1142Each element of \emph{ fieldlist} is an element of the record specified by \emph{expr}.
    11511143A record-field tuple may be used anywhere a tuple can be used. An example of the use of a record-field tuple is
    11521144the following:
     
    11881180\multicolumn{1}{c@{\hspace{30pt}}}{\textbf{\CFA}}       & \multicolumn{1}{c}{\textbf{C}}        \\
    11891181\begin{lstlisting}
    1190 `L1:` for ( ... ) {
    1191         `L2:` for ( ... ) {
    1192                 `L3:` for ( ... ) {
    1193                         ... break `L1`; ...
    1194                         ... break `L2`; ...
    1195                         ... break `L3`; // or break
     1182®L1:® for ( ... ) {
     1183        ®L2:® for ( ... ) {
     1184                ®L3:® for ( ... ) {
     1185                        ... break ®L1®; ...
     1186                        ... break ®L2®; ...
     1187                        ... break ®L3®; // or break
    11961188                }
    11971189        }
     
    12181210\multicolumn{1}{c@{\hspace{30pt}}}{\textbf{\CFA}}       & \multicolumn{1}{c}{\textbf{C}}        \\
    12191211\begin{lstlisting}
    1220 `L1`: for ( ... ) {
    1221         `L2`: for ( ... ) {
    1222                 `L3`: for ( ... ) {
    1223                         ... continue `L1`; ...
    1224                         ... continue `L2`; ...
    1225                         ... continue `L3`; ...
     1212®L1®: for ( ... ) {
     1213        ®L2®: for ( ... ) {
     1214                ®L3®: for ( ... ) {
     1215                        ... continue ®L1®; ...
     1216                        ... continue ®L2®; ...
     1217                        ... continue ®L3®; ...
    12261218
    12271219                }
     
    14591451\begin{lstlisting}
    14601452switch ( i ) {
    1461   `case 1, 3, 5`:
     1453  ®case 1, 3, 5®:
    14621454        ...
    1463   `case 2, 4, 6`:
     1455  ®case 2, 4, 6®:
    14641456        ...
    14651457}
     
    14911483\begin{lstlisting}
    14921484switch ( i ) {
    1493   `case 1~5:`
     1485  ®case 1~5:®
    14941486        ...
    1495   `case 10~15:`
     1487  ®case 10~15:®
    14961488        ...
    14971489}
     
    20482040For example, given
    20492041\begin{lstlisting}
    2050 auto j = `...`
     2042auto j = ®...®
    20512043\end{lstlisting}
    20522044and the need to write a routine to compute using \lstinline@j@
    20532045\begin{lstlisting}
    2054 void rtn( `...` parm );
     2046void rtn( ®...® parm );
    20552047rtn( j );
    20562048\end{lstlisting}
     
    23722364To make this work, a space is required after the field selection:
    23732365\begin{lstlisting}
    2374 `s.@\textvisiblespace@0` = 0;
    2375 `s.@\textvisiblespace@1` = 1;
     2366®s.§\textvisiblespace§0® = 0;
     2367®s.§\textvisiblespace§1® = 1;
    23762368\end{lstlisting}
    23772369While this sytact is awkward, it is unlikely many programers will name fields of a structure 0 or 1.
    2378 Like the \CC lexical problem with closing template-syntax, e.g, \lstinline@Foo<Bar<int`>>`@, this issue can be solved with a more powerful lexer/parser.
     2370Like the \CC lexical problem with closing template-syntax, e.g, \lstinline@Foo<Bar<int®>>®@, this issue can be solved with a more powerful lexer/parser.
    23792371
    23802372There are several ambiguous cases with operator identifiers, e.g., \lstinline@int *?*?()@, where the string \lstinline@*?*?@ can be lexed as \lstinline@*@/\lstinline@?*?@ or \lstinline@*?@/\lstinline@*?@.
     
    23832375The first case is for the function-call identifier \lstinline@?()@:
    23842376\begin{lstlisting}
    2385 int *@\textvisiblespace@?()();  // declaration: space required after '*'
    2386 *@\textvisiblespace@?()();              // expression: space required after '*'
     2377int *§\textvisiblespace§?()();  // declaration: space required after '*'
     2378*§\textvisiblespace§?()();              // expression: space required after '*'
    23872379\end{lstlisting}
    23882380Without the space, the string \lstinline@*?()@ is ambiguous without N character look ahead;
     
    23912383The 4 remaining cases occur in expressions:
    23922384\begin{lstlisting}
    2393 i++@\textvisiblespace@?i:0;             // space required before '?'
    2394 i--@\textvisiblespace@?i:0;             // space required before '?'
    2395 i@\textvisiblespace@?++i:0;             // space required after '?'
    2396 i@\textvisiblespace@?--i:0;             // space required after '?'
     2385i++§\textvisiblespace§?i:0;             // space required before '?'
     2386i--§\textvisiblespace§?i:0;             // space required before '?'
     2387i§\textvisiblespace§?++i:0;             // space required after '?'
     2388i§\textvisiblespace§?--i:0;             // space required after '?'
    23972389\end{lstlisting}
    23982390In the first two cases, the string \lstinline@i++?@ is ambiguous, where this string can be lexed as \lstinline@i@ / \lstinline@++?@ or \lstinline@i++@ / \lstinline@?@;
     
    33253317
    33263318
    3327 \subsection{Comparing Key Features of \CFA}
     3319\subsection[Comparing Key Features of CFA]{Comparing Key Features of \CFA}
    33283320
    33293321
     
    36993691
    37003692\begin{comment}
    3701 \subsubsection{Modules/Packages}
     3693\subsubsection{Modules / Packages}
    37023694
    37033695\begin{lstlisting}
     
    39413933
    39423934
    3943 \subsubsection{\CC}
     3935\subsubsection[C++]{\CC}
    39443936
    39453937\CC is a general-purpose programming language.
     
    40794071Given that nested types in C are equivalent to not using them, i.e., they are essentially useless, it is unlikely there are any realistic usages that break because of this incompatibility.
    40804072
    4081 
    40824073\item
    40834074Change: In C++, the name of a nested class is local to its enclosing class.
     
    40904081struct Y yy; // valid C, invalid C++
    40914082\end{lstlisting}
    4092 Rationale: C++ classes have member functions which require that classes establish scopes. The C rule
    4093 would leave classes as an incomplete scope mechanism which would prevent C++ programmers from maintaining
    4094 locality within a class. A coherent set of scope rules for C++ based on the C rule would be very
    4095 complicated and C++ programmers would be unable to predict reliably the meanings of nontrivial examples
    4096 involving nested or local functions.
    4097 Effect on original feature: Change of semantics of welldefined
    4098 feature.
    4099 Difficulty of converting: Semantic transformation. To make the struct type name visible in the scope of
    4100 the enclosing struct, the struct tag could be declared in the scope of the enclosing struct, before the enclosing
    4101 struct is defined. Example:
     4083Rationale: C++ classes have member functions which require that classes establish scopes.
     4084The C rule would leave classes as an incomplete scope mechanism which would prevent C++ programmers from maintaining locality within a class. A coherent set of scope rules for C++ based on the C rule would be very complicated and C++ programmers would be unable to predict reliably the meanings of nontrivial examples involving nested or local functions.
     4085Effect on original feature: Change of semantics of welldefined feature.
     4086Difficulty of converting: Semantic transformation. To make the struct type name visible in the scope of the enclosing struct, the struct tag could be declared in the scope of the enclosing struct, before the enclosing struct is defined. Example:
    41024087\begin{lstlisting}
    41034088struct Y; // struct Y and struct X are at the same scope
     
    41064091};
    41074092\end{lstlisting}
    4108 All the definitions of C struct types enclosed in other struct definitions and accessed outside the scope of
    4109 the enclosing struct could be exported to the scope of the enclosing struct. Note: this is a consequence of
    4110 the difference in scope rules, which is documented in 3.3.
     4093All the definitions of C struct types enclosed in other struct definitions and accessed outside the scope of the enclosing struct could be exported to the scope of the enclosing struct.
     4094Note: this is a consequence of the difference in scope rules, which is documented in 3.3.
    41114095How widely used: Seldom.
    41124096\end{enumerate}
     
    41244108\begin{lstlisting}
    41254109int x = 0, y = 1, z = 2;
    4126 `sout` `|` x `|` y `|` z `| endl`;
     4110®sout® ®|® x ®|® y ®|® z ®| endl®;
    41274111\end{lstlisting}
    41284112&
     
    41334117\end{tabular}
    41344118\end{quote2}
    4135 The \CFA form is half as many characters, and is similar to Python I/O with respect to implicit separators.
     4119The \CFA form is half as many characters, and is similar to \Index{Python} I/O with respect to implicit separators.
    41364120
    41374121The logical-or operator is used because it is the lowest-priority overloadable operator, other than assignment.
     
    41604144A seperator does not appear at the start or end of a line.
    41614145\begin{lstlisting}[belowskip=0pt]
    4162 sout 1 | 2 | 3 | endl;
     4146sout | 1 | 2 | 3 | endl;
    41634147\end{lstlisting}
    41644148\begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    41794163which is a local mechanism to disable insertion of the separator character.
    41804164\item
    4181 A seperator does not appear before a C string starting with the \Index{extended ASCII}\index{ASCII} characters: \lstinline[mathescape=off]@([{$£¥¿«@
     4165A seperator does not appear before a C string starting with the (extended) \Index{ASCII}\index{ASCII!extended} characters: \lstinline[mathescape=off]@([{$£¥¡¿«@
    41824166%$
    41834167\begin{lstlisting}[mathescape=off]
    4184 sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x $" | 4 | "x £" | 5 | "x ¥" | 6 | "x ¿" | 7 | "x «" | 8 | endl;
     4168sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x $" | 4 | "x £" | 5 | "x ¥" | 6 | "x ¡" | 7 | "x ¿" | 8 | "x «" | 9 | endl;
    41854169\end{lstlisting}
    41864170%$
    41874171\begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
    4188 x (1 x [2 x {3 x $4 x £5 x ¥6 x ¿7 x «8
     4172x (1 x [2 x {3 x $4 x £5 x ¥6 x ¡7 x ¿8 x «9
    41894173\end{lstlisting}
    41904174%$
    41914175\item
    4192 A seperator does not appear after a C string ending with the extended ASCII characters: \lstinline@,.:;!?)]}%¢»@
     4176A seperator does not appear after a C string ending with the (extended) \Index{ASCII}\index{ASCII!extended} characters: \lstinline@,.:;!?)]}%¢»@
    41934177\begin{lstlisting}[belowskip=0pt]
    41944178sout | 1 | ", x" | 2 | ". x" | 3 | ": x" | 4 | "; x" | 5 | "! x" | 6 | "? x" | 7 | ") x" | 8 | "] x" | 9 | "} x"
    4195          | 10 | "% x" | 11 | L"¢ x" | 12 | L"» x" | endl;
     4179         | 10 | "% x" | 11 | "¢ x" | 12 | "» x" | endl;
    41964180\end{lstlisting}
    41974181\begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    41994183\end{lstlisting}
    42004184\item
    4201 A seperator does not appear before or after a C string begining/ending with the characters: \lstinline@\f\n\r\t\v\`'"@
     4185A seperator does not appear before or after a C string begining/ending with the \Index{ASCII} quote or whitespace characters: \lstinline[showspaces=true]@`'" \t\v\f\r\n@
    42024186\begin{lstlisting}[belowskip=0pt]
    4203 sout | "x '" | 1 | "' x \`" | 2 | "\` x \"" | 3 | "\" x" | endl;
    4204 \end{lstlisting}
    4205 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
    4206 x '1' x \`2\` x "3" x
    4207 \end{lstlisting}
    4208 \begin{lstlisting}[showtabs=true,aboveskip=0pt]
    4209 sout | "x\t" | 1 | "\tx" | endl;
    4210 x       1       x
     4187sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x" | "x " | 4 | " x" | "x\t" | 1 | "\tx" | endl;
     4188\end{lstlisting}
     4189\begin{lstlisting}[mathescape=off,showspaces=true,showtabs=true,aboveskip=0pt,belowskip=0pt]
     4190x`1`x'2'x"3"x x 4 x x   1       x
    42114191\end{lstlisting}
    42124192\end{enumerate}
     
    42404220\end{lstlisting}
    42414221\begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
    4242 1 2 3
     4222 1 2 3
    42434223\end{lstlisting}
    42444224\begin{lstlisting}[mathescape=off,aboveskip=0pt,aboveskip=0pt,belowskip=0pt]
     
    42514231\end{lstlisting}
    42524232%$
    4253 \VRef[Figure]{f:ExampleIO} shows an example of input and output I/O in \CFA.
    4254 
    4255 \begin{figure}
    4256 \begin{lstlisting}[mathescape=off]
     4233\begin{comment}
    42574234#include <fstream>
    42584235
    42594236int main() {
    4260         char c;                                                                                                         // basic types
    4261         short int si;
    4262         unsigned short int usi;
    4263         int i;
    4264         unsigned int ui;
    4265         long int li;
    4266         unsigned long int uli;
    4267         long long int lli;
    4268         unsigned long long int ulli;
    4269         float f;
    4270         double d;
    4271         long double ld;
    4272         float _Complex fc;
    4273         double _Complex dc;
    4274         long double _Complex ldc;
    4275         char s1[10], s2[10];
    4276 
    4277         ifstream in;                                                                                            // create / open file
    4278         open( &in, "input.data", "r" );
    4279 
    4280         &in | &c                                                                                                        // character
    4281                 | &si | &usi | &i | &ui | &li | &uli | &lli | &ulli             // integral
    4282                 | &f | &d | &ld                                                                                 // floating point
    4283                 | &fc | &dc | &ldc                                                                              // floating-point complex
    4284                 | cstr( s1 ) | cstr( s2, 10 );                                                  // C string, length unchecked and checked
    4285 
    4286         sout | c | ' ' | endl                                                                           // character
    4287                  | si | usi | i | ui | li | uli | lli | ulli | endl             // integral
    4288                  | f | d | ld | endl                                                                    // floating point
    4289                  | fc | dc | ldc | endl;                                                                // complex
    4290         sout | endl;
    4291         sout | f | "" | d | "" | ld | endl                                                      // floating point without separator
    4292                  | sepDisable | fc | dc | ldc | sepEnable | endl                // complex without separator
    4293                  | sepOn | s1 | sepOff | s2 | endl                                              // local separator removal
    4294                  | s1 | "" | s2 | endl;                                                                 // C string withou separator
    4295         sout | endl;
    4296         sepSet( sout, ", $" );                                                                          // change separator, maximum of 15 characters
    4297         sout | f | d | ld | endl                                                                        // floating point without separator
    4298                  | fc | dc | ldc | endl                                                                 // complex without separator
    4299                  | s1 | s2 | endl;
    4300 }
    4301 
    4302 $ cat input.data
    4303 A 1 2 3 4 5 6 7 8 1.1 1.2 1.3 1.1+2.3 1.1-2.3 1.1-2.3 abc xyz
    4304 $ a.out
    4305 A
    4306 1 2 3 4 5 6 7 8
    4307 1.1 1.2 1.3
    4308 1.1+2.3i 1.1-2.3i 1.1-2.3i
    4309 
    4310 1.11.21.3
    4311 1.1+2.3i1.1-2.3i1.1-2.3i
    4312  abcxyz
    4313 abcxyz
    4314 
    4315 1.1, $1.2, $1.3
    4316 1.1+2.3i, $1.1-2.3i, $1.1-2.3i
    4317 abc, $xyz
    4318 \end{lstlisting}
    4319 \caption{Example I/O}
    4320 \label{f:ExampleIO}
    4321 \end{figure}
     4237        int x = 3, y = 5, z = 7;
     4238        sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl;
     4239        sout | 1 | 2 | 3 | endl;
     4240        sout | '1' | '2' | '3' | endl;
     4241        sout | 1 | "" | 2 | "" | 3 | endl;
     4242        sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x $" | 4 | "x £" | 5 | "x ¥" | 6 | "x ¡" | 7 | "x ¿" | 8 | "x «" | 9 | endl;
     4243        sout | 1 | ", x" | 2 | ". x" | 3 | ": x" | 4 | "; x" | 5 | "! x" | 6 | "? x" | 7 | ") x" | 8 | "] x" | 9 | "} x"
     4244                 | 10 | "% x" | 11 | "¢ x" | 12 | "» x" | endl;
     4245        sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x" | "x " | 4 | " x" | "x\t" | 1 | "\tx" | endl;
     4246        sout | sepOn | 1 | 2 | 3 | sepOn | endl;        // separator at start of line
     4247        sout | 1 | sepOff | 2 | 3 | endl;                       // turn off implicit separator temporarily
     4248        sout | sepDisable | 1 | 2 | 3 | endl;           // turn off implicit separation, affects all subsequent prints
     4249        sout | 1 | sepOn | 2 | 3 | endl;                        // turn on implicit separator temporarily
     4250        sout | sepEnable | 1 | 2 | 3 | endl;            // turn on implicit separation, affects all subsequent prints
     4251        sepSet( sout, ", $" );                                          // change separator from " " to ", $"
     4252        sout | 1 | 2 | 3 | endl;
     4253
     4254}
     4255
     4256// Local Variables: //
     4257// tab-width: 4 //
     4258// End: //
     4259\end{comment}
     4260%$
    43224261
    43234262
     
    43314270
    43324271\begin{lstlisting}
    4333 forall( otype T ) T * malloc( void );
     4272forall( otype T ) T * malloc( void );§\indexc{malloc}§
    43344273forall( otype T ) T * malloc( char fill );
    43354274forall( otype T ) T * malloc( T * ptr, size_t size );
    43364275forall( otype T ) T * malloc( T * ptr, size_t size, unsigned char fill );
    4337 forall( otype T ) T * calloc( size_t size );
    4338 forall( otype T ) T * realloc( T * ptr, size_t size );
     4276forall( otype T ) T * calloc( size_t nmemb );§\indexc{calloc}§
     4277forall( otype T ) T * realloc( T * ptr, size_t size );§\indexc{ato}§
    43394278forall( otype T ) T * realloc( T * ptr, size_t size, unsigned char fill );
    43404279
    4341 forall( otype T ) T * aligned_alloc( size_t alignment );
     4280forall( otype T ) T * aligned_alloc( size_t alignment );§\indexc{ato}§
    43424281forall( otype T ) T * memalign( size_t alignment );             // deprecated
    43434282forall( otype T ) int posix_memalign( T ** ptr, size_t alignment );
     
    43484287
    43494288
    4350 \subsection{ato/strto}
    4351 
    4352 \begin{lstlisting}
    4353 int ato( const char * ptr );
     4289\subsection{ato / strto}
     4290
     4291\begin{lstlisting}
     4292int ato( const char * ptr );§\indexc{ato}§
    43544293unsigned int ato( const char * ptr );
    43554294long int ato( const char * ptr );
     
    43794318
    43804319
    4381 \subsection{bsearch/qsort}
     4320\subsection{bsearch / qsort}
    43824321
    43834322\begin{lstlisting}
    43844323forall( otype T | { int ?<?( T, T ); } )
    4385 T * bsearch( const T key, const T * arr, size_t dimension );
     4324T * bsearch( const T key, const T * arr, size_t dimension );§\indexc{bsearch}§
    43864325
    43874326forall( otype T | { int ?<?( T, T ); } )
    4388 void qsort( const T * arr, size_t dimension );
     4327void qsort( const T * arr, size_t dimension );§\indexc{qsort}§
    43894328\end{lstlisting}
    43904329
     
    43934332
    43944333\begin{lstlisting}
    4395 char abs( char );
    4396 extern "C" {
    4397 int abs( int );                         // use default C routine for int
    4398 } // extern "C"
     4334char abs( char );§\indexc{abs}§
     4335int abs( int );
    43994336long int abs( long int );
    44004337long long int abs( long long int );
     
    44024339double abs( double );
    44034340long double abs( long double );
    4404 float _Complex abs( float _Complex );
    4405 double _Complex abs( double _Complex );
    4406 long double _Complex abs( long double _Complex );
    4407 \end{lstlisting}
    4408 
    4409 
    4410 \subsection{floor/ceil}
    4411 
    4412 \begin{lstlisting}
    4413 float floor( float );
    4414 extern "C" {
    4415 double floor( double );         // use C routine for double
    4416 } // extern "C"
    4417 long double floor( long double );
    4418 
    4419 float ceil( float );
    4420 extern "C" {
    4421 double ceil( double );          // use C routine for double
    4422 } // extern "C"
    4423 long double ceil( long double );
     4341float abs( float _Complex );
     4342double abs( double _Complex );
     4343long double abs( long double _Complex );
    44244344\end{lstlisting}
    44254345
     
    44284348
    44294349\begin{lstlisting}
    4430 void rand48seed( long int s );
    4431 char rand48();
     4350void rand48seed( long int s );§\indexc{rand48seed}§
     4351char rand48();§\indexc{rand48}§
    44324352int rand48();
    44334353unsigned int rand48();
     
    44424362
    44434363
    4444 \subsection{min/max/swap}
     4364\subsection{min / max / swap}
    44454365
    44464366\begin{lstlisting}
    44474367forall( otype T | { int ?<?( T, T ); } )
    4448 T min( const T t1, const T t2 );
     4368T min( const T t1, const T t2 );§\indexc{min}§
    44494369
    44504370forall( otype T | { int ?>?( T, T ); } )
    4451 T max( const T t1, const T t2 );
     4371T max( const T t1, const T t2 );§\indexc{max}§
    44524372
    44534373forall( otype T )
    4454 void swap( T * t1, T * t2 );
     4374void swap( T * t1, T * t2 );§\indexc{swap}§
     4375\end{lstlisting}
     4376
     4377
     4378\section{Math Library}
     4379\label{s:Math Library}
     4380
     4381The goal of the \CFA math-library is to wrap many of the existing C math library-routines that are explicitly polymorphic into implicitly polymorphic versions.
     4382
     4383
     4384\subsection{General}
     4385
     4386\begin{lstlisting}
     4387float fabs( float );§\indexc{fabs}§
     4388double fabs( double );
     4389long double fabs( long double );
     4390float cabs( float _Complex );
     4391double cabs( double _Complex );
     4392long double cabs( long double _Complex );
     4393
     4394float ?%?( float, float );§\indexc{fmod}§
     4395float fmod( float, float );
     4396double ?%?( double, double );
     4397double fmod( double, double );
     4398long double ?%?( long double, long double );
     4399long double fmod( long double, long double );
     4400
     4401float remainder( float, float );§\indexc{remainder}§
     4402double remainder( double, double );
     4403long double remainder( long double, long double );
     4404
     4405[ int, float ] remquo( float, float );§\indexc{remquo}§
     4406float remquo( float, float, int * );
     4407[ int, double ] remquo( double, double );
     4408double remquo( double, double, int * );
     4409[ int, long double ] remquo( long double, long double );
     4410long double remquo( long double, long double, int * );
     4411
     4412[ int, float ] div( float, float );                                             // alternative name for remquo
     4413float div( float, float, int * );§\indexc{div}§
     4414[ int, double ] div( double, double );
     4415double div( double, double, int * );
     4416[ int, long double ] div( long double, long double );
     4417long double div( long double, long double, int * );
     4418
     4419float fma( float, float, float );§\indexc{fma}§
     4420double fma( double, double, double );
     4421long double fma( long double, long double, long double );
     4422
     4423float fdim( float, float );§\indexc{fdim}§
     4424double fdim( double, double );
     4425long double fdim( long double, long double );
     4426
     4427float nan( const char * );§\indexc{nan}§
     4428double nan( const char * );
     4429long double nan( const char * );
     4430\end{lstlisting}
     4431
     4432
     4433\subsection{Exponential}
     4434
     4435\begin{lstlisting}
     4436float exp( float );§\indexc{exp}§
     4437double exp( double );
     4438long double exp( long double );
     4439float _Complex exp( float _Complex );
     4440double _Complex exp( double _Complex );
     4441long double _Complex exp( long double _Complex );
     4442
     4443float exp2( float );§\indexc{exp2}§
     4444double exp2( double );
     4445long double exp2( long double );
     4446float _Complex exp2( float _Complex );
     4447double _Complex exp2( double _Complex );
     4448long double _Complex exp2( long double _Complex );
     4449
     4450float expm1( float );§\indexc{expm1}§
     4451double expm1( double );
     4452long double expm1( long double );
     4453
     4454float log( float );§\indexc{log}§
     4455double log( double );
     4456long double log( long double );
     4457float _Complex log( float _Complex );
     4458double _Complex log( double _Complex );
     4459long double _Complex log( long double _Complex );
     4460
     4461float log2( float );§\indexc{log2}§
     4462double log2( double );
     4463long double log2( long double );
     4464float _Complex log2( float _Complex );
     4465double _Complex log2( double _Complex );
     4466long double _Complex log2( long double _Complex );
     4467
     4468float log10( float );§\indexc{log10}§
     4469double log10( double );
     4470long double log10( long double );
     4471float _Complex log10( float _Complex );
     4472double _Complex log10( double _Complex );
     4473long double _Complex log10( long double _Complex );
     4474
     4475float log1p( float );§\indexc{log1p}§
     4476double log1p( double );
     4477long double log1p( long double );
     4478
     4479int ilogb( float );§\indexc{ilogb}§
     4480int ilogb( double );
     4481int ilogb( long double );
     4482
     4483float logb( float );§\indexc{logb}§
     4484double logb( double );
     4485long double logb( long double );
     4486\end{lstlisting}
     4487
     4488
     4489\subsection{Power}
     4490
     4491\begin{lstlisting}
     4492float sqrt( float );§\indexc{sqrt}§
     4493double sqrt( double );
     4494long double sqrt( long double );
     4495float _Complex sqrt( float _Complex );
     4496double _Complex sqrt( double _Complex );
     4497long double _Complex sqrt( long double _Complex );
     4498
     4499float cbrt( float );§\indexc{cbrt}§
     4500double cbrt( double );
     4501long double cbrt( long double );
     4502
     4503float hypot( float, float );§\indexc{hypot}§
     4504double hypot( double, double );
     4505long double hypot( long double, long double );
     4506
     4507float pow( float, float );§\indexc{pow}§
     4508double pow( double, double );
     4509long double pow( long double, long double );
     4510float _Complex pow( float _Complex, float _Complex );
     4511double _Complex pow( double _Complex, double _Complex );
     4512long double _Complex pow( long double _Complex, long double _Complex );
     4513\end{lstlisting}
     4514
     4515
     4516\subsection{Trigonometric}
     4517
     4518\begin{lstlisting}
     4519float sin( float );§\indexc{sin}§
     4520double sin( double );
     4521long double sin( long double );
     4522float _Complex sin( float _Complex );
     4523double _Complex sin( double _Complex );
     4524long double _Complex sin( long double _Complex );
     4525
     4526float cos( float );§\indexc{cos}§
     4527double cos( double );
     4528long double cos( long double );
     4529float _Complex cos( float _Complex );
     4530double _Complex cos( double _Complex );
     4531long double _Complex cos( long double _Complex );
     4532
     4533float tan( float );§\indexc{tan}§
     4534double tan( double );
     4535long double tan( long double );
     4536float _Complex tan( float _Complex );
     4537double _Complex tan( double _Complex );
     4538long double _Complex tan( long double _Complex );
     4539
     4540float asin( float );§\indexc{asin}§
     4541double asin( double );
     4542long double asin( long double );
     4543float _Complex asin( float _Complex );
     4544double _Complex asin( double _Complex );
     4545long double _Complex asin( long double _Complex );
     4546
     4547float acos( float );§\indexc{acos}§
     4548double acos( double );
     4549long double acos( long double );
     4550float _Complex acos( float _Complex );
     4551double _Complex acos( double _Complex );
     4552long double _Complex acos( long double _Complex );
     4553
     4554float atan( float );§\indexc{atan}§
     4555double atan( double );
     4556long double atan( long double );
     4557float _Complex atan( float _Complex );
     4558double _Complex atan( double _Complex );
     4559long double _Complex atan( long double _Complex );
     4560
     4561float atan2( float, float );§\indexc{atan2}§
     4562double atan2( double, double );
     4563long double atan2( long double, long double );
     4564
     4565float atan( float, float );                                                             // alternative name for atan2
     4566double atan( double, double );§\indexc{atan}§
     4567long double atan( long double, long double );
     4568\end{lstlisting}
     4569
     4570
     4571\subsection{Hyperbolic}
     4572
     4573\begin{lstlisting}
     4574float sinh( float );§\indexc{sinh}§
     4575double sinh( double );
     4576long double sinh( long double );
     4577float _Complex sinh( float _Complex );
     4578double _Complex sinh( double _Complex );
     4579long double _Complex sinh( long double _Complex );
     4580
     4581float cosh( float );§\indexc{cosh}§
     4582double cosh( double );
     4583long double cosh( long double );
     4584float _Complex cosh( float _Complex );
     4585double _Complex cosh( double _Complex );
     4586long double _Complex cosh( long double _Complex );
     4587
     4588float tanh( float );§\indexc{tanh}§
     4589double tanh( double );
     4590long double tanh( long double );
     4591float _Complex tanh( float _Complex );
     4592double _Complex tanh( double _Complex );
     4593long double _Complex tanh( long double _Complex );
     4594
     4595float asinh( float );§\indexc{asinh}§
     4596double asinh( double );
     4597long double asinh( long double );
     4598float _Complex asinh( float _Complex );
     4599double _Complex asinh( double _Complex );
     4600long double _Complex asinh( long double _Complex );
     4601
     4602float acosh( float );§\indexc{acosh}§
     4603double acosh( double );
     4604long double acosh( long double );
     4605float _Complex acosh( float _Complex );
     4606double _Complex acosh( double _Complex );
     4607long double _Complex acosh( long double _Complex );
     4608
     4609float atanh( float );§\indexc{atanh}§
     4610double atanh( double );
     4611long double atanh( long double );
     4612float _Complex atanh( float _Complex );
     4613double _Complex atanh( double _Complex );
     4614long double _Complex atanh( long double _Complex );
     4615\end{lstlisting}
     4616
     4617
     4618\subsection{Error / Gamma}
     4619
     4620\begin{lstlisting}
     4621float erf( float );§\indexc{erf}§
     4622double erf( double );
     4623long double erf( long double );
     4624float _Complex erf( float _Complex );
     4625double _Complex erf( double _Complex );
     4626long double _Complex erf( long double _Complex );
     4627
     4628float erfc( float );§\indexc{erfc}§
     4629double erfc( double );
     4630long double erfc( long double );
     4631float _Complex erfc( float _Complex );
     4632double _Complex erfc( double _Complex );
     4633long double _Complex erfc( long double _Complex );
     4634
     4635float lgamma( float );§\indexc{lgamma}§
     4636double lgamma( double );
     4637long double lgamma( long double );
     4638float lgamma( float, int * );
     4639double lgamma( double, int * );
     4640long double lgamma( long double, int * );
     4641
     4642float tgamma( float );§\indexc{tgamma}§
     4643double tgamma( double );
     4644long double tgamma( long double );
     4645\end{lstlisting}
     4646
     4647
     4648\subsection{Nearest Integer}
     4649
     4650\begin{lstlisting}
     4651float floor( float );§\indexc{floor}§
     4652double floor( double );
     4653long double floor( long double );
     4654
     4655float ceil( float );§\indexc{ceil}§
     4656double ceil( double );
     4657long double ceil( long double );
     4658
     4659float trunc( float );§\indexc{trunc}§
     4660double trunc( double );
     4661long double trunc( long double );
     4662
     4663float rint( float );§\indexc{rint}§
     4664long double rint( long double );
     4665long int rint( float );
     4666long int rint( double );
     4667long int rint( long double );
     4668long long int rint( float );
     4669long long int rint( double );
     4670long long int rint( long double );
     4671
     4672long int lrint( float );§\indexc{lrint}§
     4673long int lrint( double );
     4674long int lrint( long double );
     4675long long int llrint( float );
     4676long long int llrint( double );
     4677long long int llrint( long double );
     4678
     4679float nearbyint( float );§\indexc{nearbyint}§
     4680double nearbyint( double );
     4681long double nearbyint( long double );
     4682
     4683float round( float );§\indexc{round}§
     4684long double round( long double );
     4685long int round( float );
     4686long int round( double );
     4687long int round( long double );
     4688long long int round( float );
     4689long long int round( double );
     4690long long int round( long double );
     4691
     4692long int lround( float );§\indexc{lround}§
     4693long int lround( double );
     4694long int lround( long double );
     4695long long int llround( float );
     4696long long int llround( double );
     4697long long int llround( long double );
     4698\end{lstlisting}
     4699
     4700
     4701\subsection{Manipulation}
     4702
     4703\begin{lstlisting}
     4704float copysign( float, float );§\indexc{copysign}§
     4705double copysign( double, double );
     4706long double copysign( long double, long double );
     4707
     4708float frexp( float, int * );§\indexc{frexp}§
     4709double frexp( double, int * );
     4710long double frexp( long double, int * );
     4711
     4712float ldexp( float, int );§\indexc{ldexp}§
     4713double ldexp( double, int );
     4714long double ldexp( long double, int );
     4715
     4716[ float, float ] modf( float );§\indexc{modf}§
     4717float modf( float, float * );
     4718[ double, double ] modf( double );
     4719double modf( double, double * );
     4720[ long double, long double ] modf( long double );
     4721long double modf( long double, long double * );
     4722
     4723float nextafter( float, float );§\indexc{nextafter}§
     4724double nextafter( double, double );
     4725long double nextafter( long double, long double );
     4726
     4727float nexttoward( float, long double );§\indexc{nexttoward}§
     4728double nexttoward( double, long double );
     4729long double nexttoward( long double, long double );
     4730
     4731float scalbn( float, int );§\indexc{scalbn}§
     4732double scalbn( double, int );
     4733long double scalbn( long double, int );
     4734
     4735float scalbln( float, long int );§\indexc{scalbln}§
     4736double scalbln( double, long int );
     4737long double scalbln( long double, long int );
    44554738\end{lstlisting}
    44564739
     
    44644747\begin{lstlisting}
    44654748// implementation
    4466 struct Rational {
     4749struct Rational {§\indexc{Rational}§
    44674750        long int numerator, denominator;                                        // invariant: denominator > 0
    44684751}; // Rational
Note: See TracChangeset for help on using the changeset viewer.