diff options
Diffstat (limited to 'doc/gawk.texi')
-rw-r--r-- | doc/gawk.texi | 137 |
1 files changed, 68 insertions, 69 deletions
diff --git a/doc/gawk.texi b/doc/gawk.texi index 02b7623b..835dbc00 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -14747,13 +14747,7 @@ Optional parameters are enclosed in square brackets@w{ ([ ]):} @item atan2(@var{y}, @var{x}) @cindex @code{atan2()} function Return the arctangent of @code{@var{y} / @var{x}} in radians. -You can use @samp{pi = atan2(0, -1)} to retrieve the value of -@tex -$\pi$. -@end tex -@ifnottex -pi. -@end ifnottex +You can use @samp{pi = atan2(0, -1)} to retrieve the value of @value{PI}. @item cos(@var{x}) @cindex @code{cos()} function @@ -15625,22 +15619,23 @@ through unchanged. This is illustrated in @ref{table-sub-escapes}. @caption{Historical Escape Sequence Processing for @code{sub()} and @code{gsub()}} @tex \vbox{\bigskip -% This table has lots of &'s and \'s, so unspecialize them. +% We need more characters for escape and tab ... +\catcode`_ = 0 +\catcode`! = 4 +% ... since this table has lots of &'s and \'s, so we unspecialize them. \catcode`\& = \other \catcode`\\ = \other -% But then we need character for escape and tab. -@catcode`! = 4 -@halign{@hfil#!@qquad@hfil#!@qquad#@hfil@cr - You type!@code{sub()} sees!@code{sub()} generates@cr -@hrulefill!@hrulefill!@hrulefill@cr - @code{\&}! @code{&}!the matched text@cr - @code{\\&}! @code{\&}!a literal @samp{&}@cr - @code{\\\&}! @code{\&}!a literal @samp{&}@cr -@code{\\\\&}! @code{\\&}!a literal @samp{\&}@cr -@code{\\\\\&}! @code{\\&}!a literal @samp{\&}@cr -@code{\\\\\\&}! @code{\\\&}!a literal @samp{\\&}@cr - @code{\\q}! @code{\q}!a literal @samp{\q}@cr +_halign{_hfil#!_qquad_hfil#!_qquad#_hfil_cr + You type!@code{sub()} sees!@code{sub()} generates_cr +_hrulefill!_hrulefill!_hrulefill_cr + @code{\&}! @code{&}!the matched text_cr + @code{\\&}! @code{\&}!a literal @samp{&}_cr + @code{\\\&}! @code{\&}!a literal @samp{&}_cr + @code{\\\\&}! @code{\\&}!a literal @samp{\&}_cr + @code{\\\\\&}! @code{\\&}!a literal @samp{\&}_cr +@code{\\\\\\&}! @code{\\\&}!a literal @samp{\\&}_cr + @code{\\q}! @code{\q}!a literal @samp{\q}_cr } -@bigskip} +_bigskip} @end tex @ifdocbook @multitable @columnfractions .20 .20 .60 @@ -15694,17 +15689,18 @@ as shown in @ref{table-sub-posix-92}. @c thanks to Karl Berry for formatting this table @tex \vbox{\bigskip -% This table has lots of &'s and \'s, so unspecialize them. +% We need more characters for escape and tab ... +\catcode`_ = 0 +\catcode`! = 4 +% ... since this table has lots of &'s and \'s, so we unspecialize them. \catcode`\& = \other \catcode`\\ = \other -% But then we need character for escape and tab. -@catcode`! = 4 -@halign{@hfil#!@qquad@hfil#!@qquad#@hfil@cr - You type!@code{sub()} sees!@code{sub()} generates@cr -@hrulefill!@hrulefill!@hrulefill@cr - @code{&}! @code{&}!the matched text@cr - @code{\\&}! @code{\&}!a literal @samp{&}@cr -@code{\\\\&}! @code{\\&}!a literal @samp{\}, then the matched text@cr -@code{\\\\\\&}! @code{\\\&}!a literal @samp{\&}@cr +_halign{_hfil#!_qquad_hfil#!_qquad#_hfil_cr + You type!@code{sub()} sees!@code{sub()} generates_cr +_hrulefill!_hrulefill!_hrulefill_cr + @code{&}! @code{&}!the matched text_cr + @code{\\&}! @code{\&}!a literal @samp{&}_cr +@code{\\\\&}! @code{\\&}!a literal @samp{\}, then the matched text_cr +@code{\\\\\\&}! @code{\\\&}!a literal @samp{\&}_cr } @bigskip} @end tex @@ -15762,20 +15758,21 @@ to produce a @samp{\} preceding the matched text. This is shown in @caption{Proposed Rules For @code{sub()} And Backslash} @tex \vbox{\bigskip -% This table has lots of &'s and \'s, so unspecialize them. +% We need more characters for escape and tab ... +\catcode`_ = 0 +\catcode`! = 4 +% ... since this table has lots of &'s and \'s, so we unspecialize them. \catcode`\& = \other \catcode`\\ = \other -% But then we need character for escape and tab. -@catcode`! = 4 -@halign{@hfil#!@qquad@hfil#!@qquad#@hfil@cr - You type!@code{sub()} sees!@code{sub()} generates@cr -@hrulefill!@hrulefill!@hrulefill@cr -@code{\\\\\\&}! @code{\\\&}!a literal @samp{\&}@cr -@code{\\\\&}! @code{\\&}!a literal @samp{\}, followed by the matched text@cr - @code{\\&}! @code{\&}!a literal @samp{&}@cr - @code{\\q}! @code{\q}!a literal @samp{\q}@cr - @code{\\\\}! @code{\\}!@code{\\}@cr +_halign{_hfil#!_qquad_hfil#!_qquad#_hfil_cr + You type!@code{sub()} sees!@code{sub()} generates_cr +_hrulefill!_hrulefill!_hrulefill_cr +@code{\\\\\\&}! @code{\\\&}!a literal @samp{\&}_cr +@code{\\\\&}! @code{\\&}!a literal @samp{\}, followed by the matched text_cr + @code{\\&}! @code{\&}!a literal @samp{&}_cr + @code{\\q}! @code{\q}!a literal @samp{\q}_cr + @code{\\\\}! @code{\\}!@code{\\}_cr } -@bigskip} +_bigskip} @end tex @ifdocbook @multitable @columnfractions .20 .20 .60 @@ -15824,20 +15821,21 @@ These rules are presented in @ref{table-posix-sub}. @caption{POSIX Rules For @code{sub()} And @code{gsub()}} @tex \vbox{\bigskip -% This table has lots of &'s and \'s, so unspecialize them. +% We need more characters for escape and tab ... +\catcode`_ = 0 +\catcode`! = 4 +% ... since this table has lots of &'s and \'s, so we unspecialize them. \catcode`\& = \other \catcode`\\ = \other -% But then we need character for escape and tab. -@catcode`! = 4 -@halign{@hfil#!@qquad@hfil#!@qquad#@hfil@cr - You type!@code{sub()} sees!@code{sub()} generates@cr -@hrulefill!@hrulefill!@hrulefill@cr -@code{\\\\\\&}! @code{\\\&}!a literal @samp{\&}@cr -@code{\\\\&}! @code{\\&}!a literal @samp{\}, followed by the matched text@cr - @code{\\&}! @code{\&}!a literal @samp{&}@cr - @code{\\q}! @code{\q}!a literal @samp{\q}@cr - @code{\\\\}! @code{\\}!@code{\}@cr +_halign{_hfil#!_qquad_hfil#!_qquad#_hfil_cr + You type!@code{sub()} sees!@code{sub()} generates_cr +_hrulefill!_hrulefill!_hrulefill_cr +@code{\\\\\\&}! @code{\\\&}!a literal @samp{\&}_cr +@code{\\\\&}! @code{\\&}!a literal @samp{\}, followed by the matched text_cr + @code{\\&}! @code{\&}!a literal @samp{&}_cr + @code{\\q}! @code{\q}!a literal @samp{\q}_cr + @code{\\\\}! @code{\\}!@code{\}_cr } -@bigskip} +_bigskip} @end tex @ifdocbook @multitable @columnfractions .20 .20 .60 @@ -15872,7 +15870,7 @@ when @option{--posix} is specified (@pxref{Options}). Otherwise, it continued to follow the 1996 proposed rules, since that had been its behavior for many years. -When @value{PVERSION} 4.0.0, was released, the @command{gawk} maintainer +When @value{PVERSION} 4.0.0 was released, the @command{gawk} maintainer made the POSIX rules the default, breaking well over a decade's worth of backwards compatibility.@footnote{This was rather naive of him, despite there being a note in this section indicating that the next major version @@ -15892,21 +15890,22 @@ as shown in @ref{table-gensub-escapes}. @caption{Escape Sequence Processing For @code{gensub()}} @tex \vbox{\bigskip -% This table has lots of &'s and \'s, so unspecialize them. +% We need more characters for escape and tab ... +\catcode`_ = 0 +\catcode`! = 4 +% ... since this table has lots of &'s and \'s, so we unspecialize them. \catcode`\& = \other \catcode`\\ = \other -% But then we need character for escape and tab. -@catcode`! = 4 -@halign{@hfil#!@qquad@hfil#!@qquad#@hfil@cr - You type!@code{gensub()} sees!@code{gensub()} generates@cr -@hrulefill!@hrulefill!@hrulefill@cr - @code{&}! @code{&}!the matched text@cr - @code{\\&}! @code{\&}!a literal @samp{&}@cr - @code{\\\\}! @code{\\}!a literal @samp{\}@cr - @code{\\\\&}! @code{\\&}!a literal @samp{\}, then the matched text@cr -@code{\\\\\\&}! @code{\\\&}!a literal @samp{\&}@cr - @code{\\q}! @code{\q}!a literal @samp{q}@cr +_halign{_hfil#!_qquad_hfil#!_qquad#_hfil_cr + You type!@code{gensub()} sees!@code{gensub()} generates_cr +_hrulefill!_hrulefill!_hrulefill_cr + @code{&}! @code{&}!the matched text_cr + @code{\\&}! @code{\&}!a literal @samp{&}_cr + @code{\\\\}! @code{\\}!a literal @samp{\}_cr + @code{\\\\&}! @code{\\&}!a literal @samp{\}, then the matched text_cr +@code{\\\\\\&}! @code{\\\&}!a literal @samp{\&}_cr + @code{\\q}! @code{\q}!a literal @samp{q}_cr } -@bigskip} +_bigskip} @end tex @ifdocbook @multitable @columnfractions .20 .20 .60 |