gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-1246-gddc290


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-1246-gddc2905
Date: Fri, 03 Apr 2015 06:09:28 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, master has been updated
       via  ddc290584b39bab2c1edcec935a31ea12d343246 (commit)
      from  902b25a40d5cc612dd7a0becb27a5a48afa49716 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=ddc290584b39bab2c1edcec935a31ea12d343246

commit ddc290584b39bab2c1edcec935a31ea12d343246
Author: Arnold D. Robbins <address@hidden>
Date:   Fri Apr 3 09:08:54 2015 +0300

    Rename "div()" to "intdiv()".

diff --git a/ChangeLog b/ChangeLog
index 9b2490b..0a39556 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2015-04-02         Arnold D. Robbins     <address@hidden>
+
+       Rename div() to intdiv().
+
+       * builtin.c (do_intdiv): Renamed from do_div.
+       * mfpr.c (do_mpfr_intdiv): Renamed from do_mpfr_div.
+       * awk.h: Update declarations.
+       * awkgram.y (tokentab, snode): Revise accordingly.
+
 2015-03-31         Arnold D. Robbins     <address@hidden>
 
        * awk.h (call_sub): Renamed from call_sub_func.
diff --git a/awk.h b/awk.h
index 384e6f1..6f812e7 100644
--- a/awk.h
+++ b/awk.h
@@ -1383,7 +1383,7 @@ extern AWKNUM nondec2awknum(char *str, size_t len);
 extern NODE *do_dcgettext(int nargs);
 extern NODE *do_dcngettext(int nargs);
 extern NODE *do_bindtextdomain(int nargs);
-extern NODE *do_div(int nargs);
+extern NODE *do_intdiv(int nargs);
 extern int strncasecmpmbs(const unsigned char *,
                          const unsigned char *, size_t);
 /* eval.c */
@@ -1526,9 +1526,9 @@ extern NODE *do_mpfr_and(int);
 extern NODE *do_mpfr_atan2(int);
 extern NODE *do_mpfr_compl(int);
 extern NODE *do_mpfr_cos(int);
-extern NODE *do_mpfr_div(int);
 extern NODE *do_mpfr_exp(int);
 extern NODE *do_mpfr_int(int);
+extern NODE *do_mpfr_intdiv(int);
 extern NODE *do_mpfr_log(int);
 extern NODE *do_mpfr_lshift(int);
 extern NODE *do_mpfr_or(int);
diff --git a/awkgram.c b/awkgram.c
index 40f5d28..67c8fea 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -4287,7 +4287,6 @@ static const struct token tokentab[] = {
 {"dcngettext", Op_builtin,      LEX_BUILTIN,   GAWKX|A(1)|A(2)|A(3)|A(4)|A(5), 
do_dcngettext,  0},
 {"default",    Op_K_default,    LEX_DEFAULT,   GAWKX,          0,      0},
 {"delete",     Op_K_delete,     LEX_DELETE,    NOT_OLD,        0,      0},
-{"div",                Op_builtin,      LEX_BUILTIN,   GAWKX|A(3),     do_div, 
MPF(div)},
 {"do",         Op_K_do,         LEX_DO,        NOT_OLD|BREAK|CONTINUE, 0,      
0},
 {"else",       Op_K_else,       LEX_ELSE,      0,              0,      0},
 {"eval",       Op_symbol,       LEX_EVAL,      0,              0,      0},
@@ -4308,6 +4307,7 @@ static const struct token tokentab[] = {
 {"include",    Op_symbol,       LEX_INCLUDE,   GAWKX,  0,      0},
 {"index",      Op_builtin,      LEX_BUILTIN,   A(2),           do_index,       
0},
 {"int",                Op_builtin,      LEX_BUILTIN,   A(1),           do_int, 
MPF(int)},
+{"intdiv",     Op_builtin,      LEX_BUILTIN,   GAWKX|A(3),     do_intdiv,      
MPF(intdiv)},
 {"isarray",    Op_builtin,      LEX_BUILTIN,   GAWKX|A(1),     do_isarray,     
0},
 {"length",     Op_builtin,      LEX_LENGTH,    A(0)|A(1),      do_length,      
0},
 {"load",       Op_symbol,       LEX_LOAD,      GAWKX,          0,      0},
@@ -6481,9 +6481,9 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
                arg = subn->nexti;
                if (arg->nexti == arg->lasti && arg->nexti->opcode == Op_push)
                        arg->nexti->opcode = Op_push_arg;       /* argument may 
be array */
-       } else if (r->builtin == do_div
+       } else if (r->builtin == do_intdiv
 #ifdef HAVE_MPFR
-                  || r->builtin == MPF(div)
+                  || r->builtin == MPF(intdiv)
 #endif
                        ) {
                arg = subn->nexti->lasti->nexti->lasti->nexti;  /* 3rd arg list 
*/
diff --git a/awkgram.y b/awkgram.y
index 4092a17..e04c2c6 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -1949,7 +1949,6 @@ static const struct token tokentab[] = {
 {"dcngettext", Op_builtin,      LEX_BUILTIN,   GAWKX|A(1)|A(2)|A(3)|A(4)|A(5), 
do_dcngettext,  0},
 {"default",    Op_K_default,    LEX_DEFAULT,   GAWKX,          0,      0},
 {"delete",     Op_K_delete,     LEX_DELETE,    NOT_OLD,        0,      0},
-{"div",                Op_builtin,      LEX_BUILTIN,   GAWKX|A(3),     do_div, 
MPF(div)},
 {"do",         Op_K_do,         LEX_DO,        NOT_OLD|BREAK|CONTINUE, 0,      
0},
 {"else",       Op_K_else,       LEX_ELSE,      0,              0,      0},
 {"eval",       Op_symbol,       LEX_EVAL,      0,              0,      0},
@@ -1970,6 +1969,7 @@ static const struct token tokentab[] = {
 {"include",    Op_symbol,       LEX_INCLUDE,   GAWKX,  0,      0},
 {"index",      Op_builtin,      LEX_BUILTIN,   A(2),           do_index,       
0},
 {"int",                Op_builtin,      LEX_BUILTIN,   A(1),           do_int, 
MPF(int)},
+{"intdiv",     Op_builtin,      LEX_BUILTIN,   GAWKX|A(3),     do_intdiv,      
MPF(intdiv)},
 {"isarray",    Op_builtin,      LEX_BUILTIN,   GAWKX|A(1),     do_isarray,     
0},
 {"length",     Op_builtin,      LEX_LENGTH,    A(0)|A(1),      do_length,      
0},
 {"load",       Op_symbol,       LEX_LOAD,      GAWKX,          0,      0},
@@ -4143,9 +4143,9 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
                arg = subn->nexti;
                if (arg->nexti == arg->lasti && arg->nexti->opcode == Op_push)
                        arg->nexti->opcode = Op_push_arg;       /* argument may 
be array */
-       } else if (r->builtin == do_div
+       } else if (r->builtin == do_intdiv
 #ifdef HAVE_MPFR
-                  || r->builtin == MPF(div)
+                  || r->builtin == MPF(intdiv)
 #endif
                        ) {
                arg = subn->nexti->lasti->nexti->lasti->nexti;  /* 3rd arg list 
*/
diff --git a/awklib/eg/lib/div.awk b/awklib/eg/lib/intdiv.awk
similarity index 67%
rename from awklib/eg/lib/div.awk
rename to awklib/eg/lib/intdiv.awk
index 5939024..dbc553b 100644
--- a/awklib/eg/lib/div.awk
+++ b/awklib/eg/lib/intdiv.awk
@@ -1,10 +1,13 @@
-# div --- do integer division
+# intdiv --- do integer division
 
 #
 # Arnold Robbins, address@hidden, Public Domain
 # July, 2014
+#
+# Name changed from div() to intdiv()
+# April, 2015
 
-function div(numerator, denominator, result)
+function intdiv(numerator, denominator, result)
 {
     split("", result)
 
diff --git a/awklib/eg/prog/pi.awk b/awklib/eg/prog/pi.awk
index 3297bef..e1b5bc4 100644
--- a/awklib/eg/prog/pi.awk
+++ b/awklib/eg/prog/pi.awk
@@ -10,7 +10,7 @@ BEGIN {
     for (m = digits * 4; m > 0; --m) {
         d = m * 2 + 1
         x = pi * m
-        div(x, d, result)
+        intdiv(x, d, result)
         pi = result["quotient"]
         pi = pi + two
     }
diff --git a/builtin.c b/builtin.c
index 99293b9..b70176d 100644
--- a/builtin.c
+++ b/builtin.c
@@ -3752,7 +3752,7 @@ do_bindtextdomain(int nargs)
        return make_string(the_result, strlen(the_result));
 }
 
-/* do_div --- do integer division, return quotient and remainder in dest array 
*/
+/* do_intdiv --- do integer division, return quotient and remainder in dest 
array */
 
 /*
  * We define the semantics as:
@@ -3763,7 +3763,7 @@ do_bindtextdomain(int nargs)
  */
 
 NODE *
-do_div(int nargs)
+do_intdiv(int nargs)
 {
        NODE *numerator, *denominator, *result;
        double num, denom, quotient, remainder;
@@ -3771,7 +3771,7 @@ do_div(int nargs)
 
        result = POP_PARAM();
        if (result->type != Node_var_array)
-               fatal(_("div: third argument is not an array"));
+               fatal(_("intdiv: third argument is not an array"));
        assoc_clear(result);
 
        denominator = POP_SCALAR();
@@ -3779,9 +3779,9 @@ do_div(int nargs)
 
        if (do_lint) {
                if ((numerator->flags & (NUMCUR|NUMBER)) == 0)
-                       lintwarn(_("div: received non-numeric first argument"));
+                       lintwarn(_("intdiv: received non-numeric first 
argument"));
                if ((denominator->flags & (NUMCUR|NUMBER)) == 0)
-                       lintwarn(_("div: received non-numeric second 
argument"));
+                       lintwarn(_("intdiv: received non-numeric second 
argument"));
        }
 
        (void) force_number(numerator);
@@ -3790,7 +3790,7 @@ do_div(int nargs)
        denom = double_to_int(get_number_d(denominator));
 
        if (denom == 0.0)
-               fatal(_("div: division by zero attempted"));
+               fatal(_("intdiv: division by zero attempted"));
 
        quotient = double_to_int(num / denom);
        /*
diff --git a/doc/ChangeLog b/doc/ChangeLog
index e41bf15..0e88c86 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,7 @@
+2015-04-02         Arnold D. Robbins     <address@hidden>
+
+       * gawktexi.in, gawk.1, awkcard.in: Name change: div() --> intdiv().
+
 2015-03-31         Arnold D. Robbins     <address@hidden>
 
        * gawktexi.in: Update discussion of calling built-in functions
diff --git a/doc/awkcard.in b/doc/awkcard.in
index 556bdc1..2e455b2 100644
--- a/doc/awkcard.in
+++ b/doc/awkcard.in
@@ -1609,11 +1609,11 @@ expand;
 l lw(2i).
 \*(CD\*(FCatan2(\*(FIy\*(FC, \*(FIx\*(FC)\*(FR The arctangent of \*(FIy/x\fP 
in radians.
 \*(FCcos(\*(FIexpr\*(FC)\*(FR  The cosine of \*(FIexpr\fP, which is in radians.
-\*(CB\*(FCdiv(\*(FIn\*(FR\*(FC,\*(FI d\*(FR\*(FC,\*(FI res\*(FR\*(FC)\*(FR     
T{
-Return the result of integer division in \*(FIres\*(FR.\*(CD
-T}
 \*(FCexp(\*(FIexpr\*(FC)\*(FR  The exponential function (\*(FIe \*(FC^ 
\*(FIx\*(FR).
 \*(FCint(\*(FIexpr\*(FC)\*(FR  Truncate to integer.
+\*(CB\*(FCintdiv(\*(FIn\*(FR\*(FC,\*(FI d\*(FR\*(FC,\*(FI res\*(FR\*(FC)\*(FR  
T{
+Return the result of integer division in \*(FIres\*(FR.\*(CD
+T}
 \*(FClog(\*(FIexpr\*(FC)\*(FR  The natural logarithm function (base 
\*(FIe\^\*(FR).
 \*(FCrand()\fP A random number \*(FIN\fP such that 0 \(<= \*(FIN\fP < 1.
 \*(FCsin(\*(FIexpr\*(FC)\*(FR  The sine of \*(FIexpr\fP, which is in radians.
diff --git a/doc/gawk.1 b/doc/gawk.1
index 45a4c9f..cbc15d1 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -13,7 +13,7 @@
 .              if \w'\(rq' .ds rq "\(rq
 .      \}
 .\}
-.TH GAWK 1 "Mar 24 2015" "Free Software Foundation" "Utility Commands"
+.TH GAWK 1 "Apr 02 2015" "Free Software Foundation" "Utility Commands"
 .SH NAME
 gawk \- pattern scanning and processing language
 .SH SYNOPSIS
@@ -2680,7 +2680,13 @@ Return the cosine of
 .IR expr ,
 which is in radians.
 .TP
-.BI div( num ", " denom ", " result )
+.BI exp( expr )
+The exponential function.
+.TP
+.BI int( expr )
+Truncate to integer.
+.TP
+.BI intdiv( num ", " denom ", " result )
 Truncate
 .I num
 and
@@ -2697,12 +2703,6 @@ This is a
 extension, primarily of value when working with
 arbitrarily large integers.
 .TP
-.BI exp( expr )
-The exponential function.
-.TP
-.BI int( expr )
-Truncate to integer.
-.TP
 .BI log( expr )
 The natural logarithm function.
 .TP
diff --git a/doc/gawk.info b/doc/gawk.info
index 24a4a63..685df45 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -12031,7 +12031,17 @@ brackets ([ ]):
 `cos(X)'
      Return the cosine of X, with X in radians.
 
-`div(NUMERATOR, DENOMINATOR, RESULT)'
+`exp(X)'
+     Return the exponential of X (`e ^ X') or report an error if X is
+     out of range.  The range of values X can have depends on your
+     machine's floating-point representation.
+
+`int(X)'
+     Return the nearest integer to X, located between X and zero and
+     truncated toward zero.  For example, `int(3)' is 3, `int(3.9)' is
+     3, `int(-3.9)' is -3, and `int(-3)' is -3 as well.
+
+`intdiv(NUMERATOR, DENOMINATOR, RESULT)'
      Perform integer division, similar to the standard C function of the
      same name.  First, truncate `numerator' and `denominator' towards
      zero, creating integer values.  Clear the `result' array, and then
@@ -12046,16 +12056,6 @@ brackets ([ ]):
      This function is a `gawk' extension.  It is not available in
      compatibility mode (*note Options::).
 
-`exp(X)'
-     Return the exponential of X (`e ^ X') or report an error if X is
-     out of range.  The range of values X can have depends on your
-     machine's floating-point representation.
-
-`int(X)'
-     Return the nearest integer to X, located between X and zero and
-     truncated toward zero.  For example, `int(3)' is 3, `int(3.9)' is
-     3, `int(-3.9)' is -3, and `int(-3)' is -3 as well.
-
 `log(X)'
      Return the natural logarithm of X, if X is positive; otherwise,
      return `NaN' ("not a number") on IEEE 754 systems.  Additionally,
@@ -22618,14 +22618,15 @@ the following:
 `%', the result is typically an arbitrary precision floating point
 value (unless the denominator evenly divides into the numerator).  In
 order to do integer division or remainder with arbitrary precision
-integers, use the built-in `div()' function (*note Numeric Functions::).
+integers, use the built-in `intdiv()' function (*note Numeric
+Functions::).
 
-   You can simulate the `div()' function in standard `awk' using this
-user-defined function:
+   You can simulate the `intdiv()' function in standard `awk' using
+this user-defined function:
 
-     # div --- do integer division
+     # intdiv --- do integer division
 
-     function div(numerator, denominator, result)
+     function intdiv(numerator, denominator, result)
      {
          split("", result)
 
@@ -22638,8 +22639,8 @@ user-defined function:
      }
 
    The following example program, contributed by Katie Wasserman, uses
-`div()' to compute the digits of pi to as many places as you choose to
-set:
+`intdiv()' to compute the digits of pi to as many places as you choose
+to set:
 
      # pi.awk --- compute the digits of pi
 
@@ -22650,7 +22651,7 @@ set:
          for (m = digits * 4; m > 0; --m) {
              d = m * 2 + 1
              x = pi * m
-             div(x, d, result)
+             intdiv(x, d, result)
              pi = result["quotient"]
              pi = pi + two
          }
@@ -26752,8 +26753,8 @@ the current version of `gawk'.
         - The `bindtextdomain()', `dcgettext()', and `dcngettext()'
           functions for internationalization (*note Programmer i18n::)
 
-        - The `div()' function for doing integer division and remainder
-          (*note Numeric Functions::)
+        - The `intdiv()' function for doing integer division and
+          remainder (*note Numeric Functions::)
 
    * Changes and/or additions in the command-line options:
 
@@ -27213,7 +27214,7 @@ in POSIX `awk', in the order they were added to `gawk'.
    * The `igawk' program and its manual page are no longer installed
      when `gawk' is built.  *Note Igawk Program::.
 
-   * The `div()' function.  *Note Numeric Functions::.
+   * The `intdiv()' function.  *Note Numeric Functions::.
 
    * The maximum number of hexdecimal digits in `\x' escapes is now two.
      *Note Escape Sequences::.
@@ -32941,7 +32942,6 @@ Index
 * display debugger command:              Viewing And Changing Data.
                                                               (line   8)
 * display debugger options:              Debugger Info.       (line  57)
-* div:                                   Numeric Functions.   (line  18)
 * division:                              Arithmetic Ops.      (line  44)
 * do-while statement:                    Do Statement.        (line   6)
 * do-while statement, use of regexps in: Regexp Usage.        (line  19)
@@ -33061,10 +33061,10 @@ Index
 * exit status, of VMS:                   VMS Running.         (line  28)
 * exit the debugger:                     Miscellaneous Debugger Commands.
                                                               (line  99)
-* exp:                                   Numeric Functions.   (line  33)
+* exp:                                   Numeric Functions.   (line  18)
 * expand utility:                        Very Simple.         (line  73)
 * Expat XML parser library:              gawkextlib.          (line  37)
-* exponent:                              Numeric Functions.   (line  33)
+* exponent:                              Numeric Functions.   (line  18)
 * expressions:                           Expressions.         (line   6)
 * expressions, as patterns:              Expression Patterns. (line   6)
 * expressions, assignment:               Assignment Ops.      (line   6)
@@ -33608,8 +33608,9 @@ Index
 * installation, VMS:                     VMS Installation.    (line   6)
 * installing gawk:                       Installation.        (line   6)
 * instruction tracing, in debugger:      Debugger Info.       (line  90)
-* int:                                   Numeric Functions.   (line  38)
+* int:                                   Numeric Functions.   (line  23)
 * INT signal (MS-Windows):               Profiling.           (line 213)
+* intdiv:                                Numeric Functions.   (line  28)
 * integer array indices:                 Numeric Array Subscripts.
                                                               (line  31)
 * integers, arbitrary precision:         Arbitrary Precision Integers.
@@ -34349,7 +34350,7 @@ Index
 * Robbins, Miriam <2>:                   Getline/Pipe.        (line  39)
 * Robbins, Miriam:                       Acknowledgments.     (line  94)
 * Rommel, Kai Uwe:                       Contributors.        (line  42)
-* round to nearest integer:              Numeric Functions.   (line  38)
+* round to nearest integer:              Numeric Functions.   (line  23)
 * round() user-defined function:         Round Function.      (line  16)
 * rounding numbers:                      Round Function.      (line   6)
 * ROUNDMODE variable:                    User-modified.       (line 127)
@@ -35126,333 +35127,333 @@ Node: Functions504950
 Node: Built-in505989
 Node: Calling Built-in507067
 Node: Numeric Functions509062
-Ref: Numeric Functions-Footnote-1513892
-Ref: Numeric Functions-Footnote-2514249
-Ref: Numeric Functions-Footnote-3514297
-Node: String Functions514569
-Ref: String Functions-Footnote-1538070
-Ref: String Functions-Footnote-2538199
-Ref: String Functions-Footnote-3538447
-Node: Gory Details538534
-Ref: table-sub-escapes540315
-Ref: table-sub-proposed541830
-Ref: table-posix-sub543192
-Ref: table-gensub-escapes544729
-Ref: Gory Details-Footnote-1545562
-Node: I/O Functions545713
-Ref: I/O Functions-Footnote-1552949
-Node: Time Functions553096
-Ref: Time Functions-Footnote-1563605
-Ref: Time Functions-Footnote-2563673
-Ref: Time Functions-Footnote-3563831
-Ref: Time Functions-Footnote-4563942
-Ref: Time Functions-Footnote-5564054
-Ref: Time Functions-Footnote-6564281
-Node: Bitwise Functions564547
-Ref: table-bitwise-ops565109
-Ref: Bitwise Functions-Footnote-1569437
-Node: Type Functions569609
-Node: I18N Functions570761
-Node: User-defined572408
-Node: Definition Syntax573213
-Ref: Definition Syntax-Footnote-1578872
-Node: Function Example578943
-Ref: Function Example-Footnote-1581864
-Node: Function Caveats581886
-Node: Calling A Function582404
-Node: Variable Scope583362
-Node: Pass By Value/Reference586355
-Node: Return Statement589852
-Node: Dynamic Typing592831
-Node: Indirect Calls593760
-Ref: Indirect Calls-Footnote-1604003
-Node: Functions Summary604131
-Node: Library Functions606833
-Ref: Library Functions-Footnote-1610441
-Ref: Library Functions-Footnote-2610584
-Node: Library Names610755
-Ref: Library Names-Footnote-1614213
-Ref: Library Names-Footnote-2614436
-Node: General Functions614522
-Node: Strtonum Function615625
-Node: Assert Function618647
-Node: Round Function621971
-Node: Cliff Random Function623512
-Node: Ordinal Functions624528
-Ref: Ordinal Functions-Footnote-1627591
-Ref: Ordinal Functions-Footnote-2627843
-Node: Join Function628054
-Ref: Join Function-Footnote-1629824
-Node: Getlocaltime Function630024
-Node: Readfile Function633768
-Node: Shell Quoting635740
-Node: Data File Management637141
-Node: Filetrans Function637773
-Node: Rewind Function641869
-Node: File Checking643255
-Ref: File Checking-Footnote-1644588
-Node: Empty Files644789
-Node: Ignoring Assigns646768
-Node: Getopt Function648318
-Ref: Getopt Function-Footnote-1659782
-Node: Passwd Functions659982
-Ref: Passwd Functions-Footnote-1668822
-Node: Group Functions668910
-Ref: Group Functions-Footnote-1676807
-Node: Walking Arrays677012
-Node: Library Functions Summary680018
-Node: Library Exercises681420
-Node: Sample Programs682700
-Node: Running Examples683470
-Node: Clones684198
-Node: Cut Program685422
-Node: Egrep Program695142
-Ref: Egrep Program-Footnote-1702645
-Node: Id Program702755
-Node: Split Program706431
-Ref: Split Program-Footnote-1709885
-Node: Tee Program710013
-Node: Uniq Program712802
-Node: Wc Program720221
-Ref: Wc Program-Footnote-1724471
-Node: Miscellaneous Programs724565
-Node: Dupword Program725778
-Node: Alarm Program727809
-Node: Translate Program732614
-Ref: Translate Program-Footnote-1737177
-Node: Labels Program737447
-Ref: Labels Program-Footnote-1740798
-Node: Word Sorting740882
-Node: History Sorting744952
-Node: Extract Program746787
-Node: Simple Sed754311
-Node: Igawk Program757381
-Ref: Igawk Program-Footnote-1771707
-Ref: Igawk Program-Footnote-2771908
-Ref: Igawk Program-Footnote-3772030
-Node: Anagram Program772145
-Node: Signature Program775206
-Node: Programs Summary776453
-Node: Programs Exercises777674
-Ref: Programs Exercises-Footnote-1781805
-Node: Advanced Features781896
-Node: Nondecimal Data783878
-Node: Array Sorting785468
-Node: Controlling Array Traversal786168
-Ref: Controlling Array Traversal-Footnote-1794534
-Node: Array Sorting Functions794652
-Ref: Array Sorting Functions-Footnote-1798538
-Node: Two-way I/O798734
-Ref: Two-way I/O-Footnote-1803679
-Ref: Two-way I/O-Footnote-2803865
-Node: TCP/IP Networking803947
-Node: Profiling806819
-Node: Advanced Features Summary815090
-Node: Internationalization817023
-Node: I18N and L10N818503
-Node: Explaining gettext819189
-Ref: Explaining gettext-Footnote-1824214
-Ref: Explaining gettext-Footnote-2824398
-Node: Programmer i18n824563
-Ref: Programmer i18n-Footnote-1829439
-Node: Translator i18n829488
-Node: String Extraction830282
-Ref: String Extraction-Footnote-1831413
-Node: Printf Ordering831499
-Ref: Printf Ordering-Footnote-1834285
-Node: I18N Portability834349
-Ref: I18N Portability-Footnote-1836805
-Node: I18N Example836868
-Ref: I18N Example-Footnote-1839671
-Node: Gawk I18N839743
-Node: I18N Summary840387
-Node: Debugger841727
-Node: Debugging842749
-Node: Debugging Concepts843190
-Node: Debugging Terms845000
-Node: Awk Debugging847572
-Node: Sample Debugging Session848478
-Node: Debugger Invocation849012
-Node: Finding The Bug850397
-Node: List of Debugger Commands856876
-Node: Breakpoint Control858208
-Node: Debugger Execution Control861885
-Node: Viewing And Changing Data865244
-Node: Execution Stack868620
-Node: Debugger Info870255
-Node: Miscellaneous Debugger Commands874300
-Node: Readline Support879301
-Node: Limitations880195
-Node: Debugging Summary882310
-Node: Arbitrary Precision Arithmetic883484
-Node: Computer Arithmetic884900
-Ref: table-numeric-ranges888477
-Ref: Computer Arithmetic-Footnote-1889001
-Node: Math Definitions889058
-Ref: table-ieee-formats892353
-Ref: Math Definitions-Footnote-1892957
-Node: MPFR features893062
-Node: FP Math Caution894733
-Ref: FP Math Caution-Footnote-1895783
-Node: Inexactness of computations896152
-Node: Inexact representation897111
-Node: Comparing FP Values898469
-Node: Errors accumulate899551
-Node: Getting Accuracy900983
-Node: Try To Round903687
-Node: Setting precision904586
-Ref: table-predefined-precision-strings905270
-Node: Setting the rounding mode907099
-Ref: table-gawk-rounding-modes907463
-Ref: Setting the rounding mode-Footnote-1910915
-Node: Arbitrary Precision Integers911094
-Ref: Arbitrary Precision Integers-Footnote-1915992
-Node: POSIX Floating Point Problems916141
-Ref: POSIX Floating Point Problems-Footnote-1920020
-Node: Floating point summary920058
-Node: Dynamic Extensions922245
-Node: Extension Intro923797
-Node: Plugin License925062
-Node: Extension Mechanism Outline925859
-Ref: figure-load-extension926287
-Ref: figure-register-new-function927767
-Ref: figure-call-new-function928771
-Node: Extension API Description930758
-Node: Extension API Functions Introduction932292
-Node: General Data Types937161
-Ref: General Data Types-Footnote-1943061
-Node: Memory Allocation Functions943360
-Ref: Memory Allocation Functions-Footnote-1946199
-Node: Constructor Functions946298
-Node: Registration Functions948037
-Node: Extension Functions948722
-Node: Exit Callback Functions951019
-Node: Extension Version String952267
-Node: Input Parsers952930
-Node: Output Wrappers962805
-Node: Two-way processors967318
-Node: Printing Messages969581
-Ref: Printing Messages-Footnote-1970657
-Node: Updating `ERRNO'970809
-Node: Requesting Values971549
-Ref: table-value-types-returned972276
-Node: Accessing Parameters973233
-Node: Symbol Table Access974467
-Node: Symbol table by name974981
-Node: Symbol table by cookie977001
-Ref: Symbol table by cookie-Footnote-1981146
-Node: Cached values981209
-Ref: Cached values-Footnote-1984705
-Node: Array Manipulation984796
-Ref: Array Manipulation-Footnote-1985886
-Node: Array Data Types985923
-Ref: Array Data Types-Footnote-1988578
-Node: Array Functions988670
-Node: Flattening Arrays992529
-Node: Creating Arrays999431
-Node: Redirection API1004202
-Node: Extension API Variables1007027
-Node: Extension Versioning1007660
-Node: Extension API Informational Variables1009551
-Node: Extension API Boilerplate1010616
-Node: Finding Extensions1014425
-Node: Extension Example1014985
-Node: Internal File Description1015757
-Node: Internal File Ops1019824
-Ref: Internal File Ops-Footnote-11031575
-Node: Using Internal File Ops1031715
-Ref: Using Internal File Ops-Footnote-11034098
-Node: Extension Samples1034371
-Node: Extension Sample File Functions1035899
-Node: Extension Sample Fnmatch1043580
-Node: Extension Sample Fork1045068
-Node: Extension Sample Inplace1046283
-Node: Extension Sample Ord1048369
-Node: Extension Sample Readdir1049205
-Ref: table-readdir-file-types1050082
-Node: Extension Sample Revout1050893
-Node: Extension Sample Rev2way1051482
-Node: Extension Sample Read write array1052222
-Node: Extension Sample Readfile1054162
-Node: Extension Sample Time1055257
-Node: Extension Sample API Tests1056605
-Node: gawkextlib1057096
-Node: Extension summary1059797
-Node: Extension Exercises1063486
-Node: Language History1064982
-Node: V7/SVR3.11066638
-Node: SVR41068791
-Node: POSIX1070225
-Node: BTL1071606
-Node: POSIX/GNU1072337
-Node: Feature History1078173
-Node: Common Extensions1091967
-Node: Ranges and Locales1093339
-Ref: Ranges and Locales-Footnote-11097958
-Ref: Ranges and Locales-Footnote-21097985
-Ref: Ranges and Locales-Footnote-31098220
-Node: Contributors1098441
-Node: History summary1103981
-Node: Installation1105360
-Node: Gawk Distribution1106306
-Node: Getting1106790
-Node: Extracting1107613
-Node: Distribution contents1109250
-Node: Unix Installation1115352
-Node: Quick Installation1116035
-Node: Shell Startup Files1118446
-Node: Additional Configuration Options1119525
-Node: Configuration Philosophy1121329
-Node: Non-Unix Installation1123698
-Node: PC Installation1124156
-Node: PC Binary Installation1125476
-Node: PC Compiling1127324
-Ref: PC Compiling-Footnote-11130345
-Node: PC Testing1130454
-Node: PC Using1131630
-Node: Cygwin1135745
-Node: MSYS1136515
-Node: VMS Installation1137016
-Node: VMS Compilation1137808
-Ref: VMS Compilation-Footnote-11139037
-Node: VMS Dynamic Extensions1139095
-Node: VMS Installation Details1140779
-Node: VMS Running1143030
-Node: VMS GNV1145870
-Node: VMS Old Gawk1146605
-Node: Bugs1147075
-Node: Other Versions1150964
-Node: Installation summary1157398
-Node: Notes1158457
-Node: Compatibility Mode1159322
-Node: Additions1160104
-Node: Accessing The Source1161029
-Node: Adding Code1162464
-Node: New Ports1168621
-Node: Derived Files1173103
-Ref: Derived Files-Footnote-11178578
-Ref: Derived Files-Footnote-21178612
-Ref: Derived Files-Footnote-31179208
-Node: Future Extensions1179322
-Node: Implementation Limitations1179928
-Node: Extension Design1181176
-Node: Old Extension Problems1182330
-Ref: Old Extension Problems-Footnote-11183847
-Node: Extension New Mechanism Goals1183904
-Ref: Extension New Mechanism Goals-Footnote-11187264
-Node: Extension Other Design Decisions1187453
-Node: Extension Future Growth1189561
-Node: Old Extension Mechanism1190397
-Node: Notes summary1192159
-Node: Basic Concepts1193345
-Node: Basic High Level1194026
-Ref: figure-general-flow1194298
-Ref: figure-process-flow1194897
-Ref: Basic High Level-Footnote-11198126
-Node: Basic Data Typing1198311
-Node: Glossary1201639
-Node: Copying1233568
-Node: GNU Free Documentation License1271124
-Node: Index1296260
+Ref: Numeric Functions-Footnote-1513895
+Ref: Numeric Functions-Footnote-2514252
+Ref: Numeric Functions-Footnote-3514300
+Node: String Functions514572
+Ref: String Functions-Footnote-1538073
+Ref: String Functions-Footnote-2538202
+Ref: String Functions-Footnote-3538450
+Node: Gory Details538537
+Ref: table-sub-escapes540318
+Ref: table-sub-proposed541833
+Ref: table-posix-sub543195
+Ref: table-gensub-escapes544732
+Ref: Gory Details-Footnote-1545565
+Node: I/O Functions545716
+Ref: I/O Functions-Footnote-1552952
+Node: Time Functions553099
+Ref: Time Functions-Footnote-1563608
+Ref: Time Functions-Footnote-2563676
+Ref: Time Functions-Footnote-3563834
+Ref: Time Functions-Footnote-4563945
+Ref: Time Functions-Footnote-5564057
+Ref: Time Functions-Footnote-6564284
+Node: Bitwise Functions564550
+Ref: table-bitwise-ops565112
+Ref: Bitwise Functions-Footnote-1569440
+Node: Type Functions569612
+Node: I18N Functions570764
+Node: User-defined572411
+Node: Definition Syntax573216
+Ref: Definition Syntax-Footnote-1578875
+Node: Function Example578946
+Ref: Function Example-Footnote-1581867
+Node: Function Caveats581889
+Node: Calling A Function582407
+Node: Variable Scope583365
+Node: Pass By Value/Reference586358
+Node: Return Statement589855
+Node: Dynamic Typing592834
+Node: Indirect Calls593763
+Ref: Indirect Calls-Footnote-1604006
+Node: Functions Summary604134
+Node: Library Functions606836
+Ref: Library Functions-Footnote-1610444
+Ref: Library Functions-Footnote-2610587
+Node: Library Names610758
+Ref: Library Names-Footnote-1614216
+Ref: Library Names-Footnote-2614439
+Node: General Functions614525
+Node: Strtonum Function615628
+Node: Assert Function618650
+Node: Round Function621974
+Node: Cliff Random Function623515
+Node: Ordinal Functions624531
+Ref: Ordinal Functions-Footnote-1627594
+Ref: Ordinal Functions-Footnote-2627846
+Node: Join Function628057
+Ref: Join Function-Footnote-1629827
+Node: Getlocaltime Function630027
+Node: Readfile Function633771
+Node: Shell Quoting635743
+Node: Data File Management637144
+Node: Filetrans Function637776
+Node: Rewind Function641872
+Node: File Checking643258
+Ref: File Checking-Footnote-1644591
+Node: Empty Files644792
+Node: Ignoring Assigns646771
+Node: Getopt Function648321
+Ref: Getopt Function-Footnote-1659785
+Node: Passwd Functions659985
+Ref: Passwd Functions-Footnote-1668825
+Node: Group Functions668913
+Ref: Group Functions-Footnote-1676810
+Node: Walking Arrays677015
+Node: Library Functions Summary680021
+Node: Library Exercises681423
+Node: Sample Programs682703
+Node: Running Examples683473
+Node: Clones684201
+Node: Cut Program685425
+Node: Egrep Program695145
+Ref: Egrep Program-Footnote-1702648
+Node: Id Program702758
+Node: Split Program706434
+Ref: Split Program-Footnote-1709888
+Node: Tee Program710016
+Node: Uniq Program712805
+Node: Wc Program720224
+Ref: Wc Program-Footnote-1724474
+Node: Miscellaneous Programs724568
+Node: Dupword Program725781
+Node: Alarm Program727812
+Node: Translate Program732617
+Ref: Translate Program-Footnote-1737180
+Node: Labels Program737450
+Ref: Labels Program-Footnote-1740801
+Node: Word Sorting740885
+Node: History Sorting744955
+Node: Extract Program746790
+Node: Simple Sed754314
+Node: Igawk Program757384
+Ref: Igawk Program-Footnote-1771710
+Ref: Igawk Program-Footnote-2771911
+Ref: Igawk Program-Footnote-3772033
+Node: Anagram Program772148
+Node: Signature Program775209
+Node: Programs Summary776456
+Node: Programs Exercises777677
+Ref: Programs Exercises-Footnote-1781808
+Node: Advanced Features781899
+Node: Nondecimal Data783881
+Node: Array Sorting785471
+Node: Controlling Array Traversal786171
+Ref: Controlling Array Traversal-Footnote-1794537
+Node: Array Sorting Functions794655
+Ref: Array Sorting Functions-Footnote-1798541
+Node: Two-way I/O798737
+Ref: Two-way I/O-Footnote-1803682
+Ref: Two-way I/O-Footnote-2803868
+Node: TCP/IP Networking803950
+Node: Profiling806822
+Node: Advanced Features Summary815093
+Node: Internationalization817026
+Node: I18N and L10N818506
+Node: Explaining gettext819192
+Ref: Explaining gettext-Footnote-1824217
+Ref: Explaining gettext-Footnote-2824401
+Node: Programmer i18n824566
+Ref: Programmer i18n-Footnote-1829442
+Node: Translator i18n829491
+Node: String Extraction830285
+Ref: String Extraction-Footnote-1831416
+Node: Printf Ordering831502
+Ref: Printf Ordering-Footnote-1834288
+Node: I18N Portability834352
+Ref: I18N Portability-Footnote-1836808
+Node: I18N Example836871
+Ref: I18N Example-Footnote-1839674
+Node: Gawk I18N839746
+Node: I18N Summary840390
+Node: Debugger841730
+Node: Debugging842752
+Node: Debugging Concepts843193
+Node: Debugging Terms845003
+Node: Awk Debugging847575
+Node: Sample Debugging Session848481
+Node: Debugger Invocation849015
+Node: Finding The Bug850400
+Node: List of Debugger Commands856879
+Node: Breakpoint Control858211
+Node: Debugger Execution Control861888
+Node: Viewing And Changing Data865247
+Node: Execution Stack868623
+Node: Debugger Info870258
+Node: Miscellaneous Debugger Commands874303
+Node: Readline Support879304
+Node: Limitations880198
+Node: Debugging Summary882313
+Node: Arbitrary Precision Arithmetic883487
+Node: Computer Arithmetic884903
+Ref: table-numeric-ranges888480
+Ref: Computer Arithmetic-Footnote-1889004
+Node: Math Definitions889061
+Ref: table-ieee-formats892356
+Ref: Math Definitions-Footnote-1892960
+Node: MPFR features893065
+Node: FP Math Caution894736
+Ref: FP Math Caution-Footnote-1895786
+Node: Inexactness of computations896155
+Node: Inexact representation897114
+Node: Comparing FP Values898472
+Node: Errors accumulate899554
+Node: Getting Accuracy900986
+Node: Try To Round903690
+Node: Setting precision904589
+Ref: table-predefined-precision-strings905273
+Node: Setting the rounding mode907102
+Ref: table-gawk-rounding-modes907466
+Ref: Setting the rounding mode-Footnote-1910918
+Node: Arbitrary Precision Integers911097
+Ref: Arbitrary Precision Integers-Footnote-1916013
+Node: POSIX Floating Point Problems916162
+Ref: POSIX Floating Point Problems-Footnote-1920041
+Node: Floating point summary920079
+Node: Dynamic Extensions922266
+Node: Extension Intro923818
+Node: Plugin License925083
+Node: Extension Mechanism Outline925880
+Ref: figure-load-extension926308
+Ref: figure-register-new-function927788
+Ref: figure-call-new-function928792
+Node: Extension API Description930779
+Node: Extension API Functions Introduction932313
+Node: General Data Types937182
+Ref: General Data Types-Footnote-1943082
+Node: Memory Allocation Functions943381
+Ref: Memory Allocation Functions-Footnote-1946220
+Node: Constructor Functions946319
+Node: Registration Functions948058
+Node: Extension Functions948743
+Node: Exit Callback Functions951040
+Node: Extension Version String952288
+Node: Input Parsers952951
+Node: Output Wrappers962826
+Node: Two-way processors967339
+Node: Printing Messages969602
+Ref: Printing Messages-Footnote-1970678
+Node: Updating `ERRNO'970830
+Node: Requesting Values971570
+Ref: table-value-types-returned972297
+Node: Accessing Parameters973254
+Node: Symbol Table Access974488
+Node: Symbol table by name975002
+Node: Symbol table by cookie977022
+Ref: Symbol table by cookie-Footnote-1981167
+Node: Cached values981230
+Ref: Cached values-Footnote-1984726
+Node: Array Manipulation984817
+Ref: Array Manipulation-Footnote-1985907
+Node: Array Data Types985944
+Ref: Array Data Types-Footnote-1988599
+Node: Array Functions988691
+Node: Flattening Arrays992550
+Node: Creating Arrays999452
+Node: Redirection API1004223
+Node: Extension API Variables1007048
+Node: Extension Versioning1007681
+Node: Extension API Informational Variables1009572
+Node: Extension API Boilerplate1010637
+Node: Finding Extensions1014446
+Node: Extension Example1015006
+Node: Internal File Description1015778
+Node: Internal File Ops1019845
+Ref: Internal File Ops-Footnote-11031596
+Node: Using Internal File Ops1031736
+Ref: Using Internal File Ops-Footnote-11034119
+Node: Extension Samples1034392
+Node: Extension Sample File Functions1035920
+Node: Extension Sample Fnmatch1043601
+Node: Extension Sample Fork1045089
+Node: Extension Sample Inplace1046304
+Node: Extension Sample Ord1048390
+Node: Extension Sample Readdir1049226
+Ref: table-readdir-file-types1050103
+Node: Extension Sample Revout1050914
+Node: Extension Sample Rev2way1051503
+Node: Extension Sample Read write array1052243
+Node: Extension Sample Readfile1054183
+Node: Extension Sample Time1055278
+Node: Extension Sample API Tests1056626
+Node: gawkextlib1057117
+Node: Extension summary1059818
+Node: Extension Exercises1063507
+Node: Language History1065003
+Node: V7/SVR3.11066659
+Node: SVR41068812
+Node: POSIX1070246
+Node: BTL1071627
+Node: POSIX/GNU1072358
+Node: Feature History1078197
+Node: Common Extensions1091994
+Node: Ranges and Locales1093366
+Ref: Ranges and Locales-Footnote-11097985
+Ref: Ranges and Locales-Footnote-21098012
+Ref: Ranges and Locales-Footnote-31098247
+Node: Contributors1098468
+Node: History summary1104008
+Node: Installation1105387
+Node: Gawk Distribution1106333
+Node: Getting1106817
+Node: Extracting1107640
+Node: Distribution contents1109277
+Node: Unix Installation1115379
+Node: Quick Installation1116062
+Node: Shell Startup Files1118473
+Node: Additional Configuration Options1119552
+Node: Configuration Philosophy1121356
+Node: Non-Unix Installation1123725
+Node: PC Installation1124183
+Node: PC Binary Installation1125503
+Node: PC Compiling1127351
+Ref: PC Compiling-Footnote-11130372
+Node: PC Testing1130481
+Node: PC Using1131657
+Node: Cygwin1135772
+Node: MSYS1136542
+Node: VMS Installation1137043
+Node: VMS Compilation1137835
+Ref: VMS Compilation-Footnote-11139064
+Node: VMS Dynamic Extensions1139122
+Node: VMS Installation Details1140806
+Node: VMS Running1143057
+Node: VMS GNV1145897
+Node: VMS Old Gawk1146632
+Node: Bugs1147102
+Node: Other Versions1150991
+Node: Installation summary1157425
+Node: Notes1158484
+Node: Compatibility Mode1159349
+Node: Additions1160131
+Node: Accessing The Source1161056
+Node: Adding Code1162491
+Node: New Ports1168648
+Node: Derived Files1173130
+Ref: Derived Files-Footnote-11178605
+Ref: Derived Files-Footnote-21178639
+Ref: Derived Files-Footnote-31179235
+Node: Future Extensions1179349
+Node: Implementation Limitations1179955
+Node: Extension Design1181203
+Node: Old Extension Problems1182357
+Ref: Old Extension Problems-Footnote-11183874
+Node: Extension New Mechanism Goals1183931
+Ref: Extension New Mechanism Goals-Footnote-11187291
+Node: Extension Other Design Decisions1187480
+Node: Extension Future Growth1189588
+Node: Old Extension Mechanism1190424
+Node: Notes summary1192186
+Node: Basic Concepts1193372
+Node: Basic High Level1194053
+Ref: figure-general-flow1194325
+Ref: figure-process-flow1194924
+Ref: Basic High Level-Footnote-11198153
+Node: Basic Data Typing1198338
+Node: Glossary1201666
+Node: Copying1233595
+Node: GNU Free Documentation License1271151
+Node: Index1296287
 
 End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index f710d72..ca378cc 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -17089,23 +17089,6 @@ You can use @samp{pi = atan2(0, -1)} to retrieve the 
value of
 @cindex cosine
 Return the cosine of @var{x}, with @var{x} in radians.
 
address@hidden @code{div(@var{numerator}, @var{denominator}, @var{result})}
address@hidden
address@hidden div
-Perform integer division, similar to the standard C function of the
-same name.  First, truncate @code{numerator} and @code{denominator}
-towards zero, creating integer values.  Clear the @code{result}
-array, and then set @code{result["quotient"]} to the result of
address@hidden / denominator}, truncated towards zero to an integer,
-and set @code{result["remainder"]} to the result of @samp{numerator %
-denominator}, truncated towards zero to an integer.  This function is
-primarily intended for use with arbitrary length integers; it avoids
-creating MPFR arbitrary precision floating-point values (@pxref{Arbitrary
-Precision Integers}).
-
-This function is a @code{gawk} extension.  It is not available in
-compatibility mode (@pxref{Options}).
-
 @item @code{exp(@var{x})}
 @cindexawkfunc{exp}
 @cindex exponent
@@ -17121,6 +17104,23 @@ truncated toward zero.
 For example, @code{int(3)} is 3, @code{int(3.9)} is 3, @code{int(-3.9)}
 is @minus{}3, and @code{int(-3)} is @minus{}3 as well.
 
address@hidden @code{intdiv(@var{numerator}, @var{denominator}, @var{result})}
address@hidden
address@hidden intdiv
+Perform integer division, similar to the standard C function of the
+same name.  First, truncate @code{numerator} and @code{denominator}
+towards zero, creating integer values.  Clear the @code{result}
+array, and then set @code{result["quotient"]} to the result of
address@hidden / denominator}, truncated towards zero to an integer,
+and set @code{result["remainder"]} to the result of @samp{numerator %
+denominator}, truncated towards zero to an integer.  This function is
+primarily intended for use with arbitrary length integers; it avoids
+creating MPFR arbitrary precision floating-point values (@pxref{Arbitrary
+Precision Integers}).
+
+This function is a @code{gawk} extension.  It is not available in
+compatibility mode (@pxref{Options}).
+
 @item @code{log(@var{x})}
 @cindexawkfunc{log}
 @cindex logarithm
@@ -31114,27 +31114,30 @@ When dividing two arbitrary precision integers with 
either
 precision floating point value (unless the denominator evenly
 divides into the numerator).  In order to do integer division
 or remainder with arbitrary precision integers, use the built-in
address@hidden()} function (@pxref{Numeric Functions}).
address@hidden()} function (@pxref{Numeric Functions}).
 
-You can simulate the @code{div()} function in standard @command{awk}
+You can simulate the @code{intdiv()} function in standard @command{awk}
 using this user-defined function:
 
 @example
address@hidden file eg/lib/div.awk
-# div --- do integer division
address@hidden file eg/lib/intdiv.awk
+# intdiv --- do integer division
 
 @c endfile
 @ignore
address@hidden file eg/lib/div.awk
address@hidden file eg/lib/intdiv.awk
 #
 # Arnold Robbins, arnold@@skeeve.com, Public Domain
 # July, 2014
+#
+# Name changed from div() to intdiv()
+# April, 2015
 
 @c endfile
 
 @end ignore
address@hidden file eg/lib/div.awk
-function div(numerator, denominator, result)
address@hidden file eg/lib/intdiv.awk
+function intdiv(numerator, denominator, result)
 @{
     split("", result)
 
@@ -31149,7 +31152,7 @@ function div(numerator, denominator, result)
 @end example
 
 The following example program, contributed by Katie Wasserman,
-uses @code{div()} to
+uses @code{intdiv()} to
 compute the digits of @value{PI} to as many places as you
 choose to set:
 
@@ -31174,7 +31177,7 @@ BEGIN @{
     for (m = digits * 4; m > 0; --m) @{
         d = m * 2 + 1
         x = pi * m
-        div(x, d, result)
+        intdiv(x, d, result)
         pi = result["quotient"]
         pi = pi + two
     @}
@@ -36043,7 +36046,7 @@ functions for internationalization
 (@pxref{Programmer i18n})
 
 @item
-The @code{div()} function for doing integer
+The @code{intdiv()} function for doing integer
 division and remainder
 (@pxref{Numeric Functions})
 @end itemize
@@ -36824,7 +36827,7 @@ installed when @command{gawk} is built.
 @xref{Igawk Program}.
 
 @item
-The @code{div()} function.
+The @code{intdiv()} function.
 @xref{Numeric Functions}.
 
 @item
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 4e2b67d..4cd0476 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -16371,23 +16371,6 @@ You can use @samp{pi = atan2(0, -1)} to retrieve the 
value of
 @cindex cosine
 Return the cosine of @var{x}, with @var{x} in radians.
 
address@hidden @code{div(@var{numerator}, @var{denominator}, @var{result})}
address@hidden
address@hidden div
-Perform integer division, similar to the standard C function of the
-same name.  First, truncate @code{numerator} and @code{denominator}
-towards zero, creating integer values.  Clear the @code{result}
-array, and then set @code{result["quotient"]} to the result of
address@hidden / denominator}, truncated towards zero to an integer,
-and set @code{result["remainder"]} to the result of @samp{numerator %
-denominator}, truncated towards zero to an integer.  This function is
-primarily intended for use with arbitrary length integers; it avoids
-creating MPFR arbitrary precision floating-point values (@pxref{Arbitrary
-Precision Integers}).
-
-This function is a @code{gawk} extension.  It is not available in
-compatibility mode (@pxref{Options}).
-
 @item @code{exp(@var{x})}
 @cindexawkfunc{exp}
 @cindex exponent
@@ -16403,6 +16386,23 @@ truncated toward zero.
 For example, @code{int(3)} is 3, @code{int(3.9)} is 3, @code{int(-3.9)}
 is @minus{}3, and @code{int(-3)} is @minus{}3 as well.
 
address@hidden @code{intdiv(@var{numerator}, @var{denominator}, @var{result})}
address@hidden
address@hidden intdiv
+Perform integer division, similar to the standard C function of the
+same name.  First, truncate @code{numerator} and @code{denominator}
+towards zero, creating integer values.  Clear the @code{result}
+array, and then set @code{result["quotient"]} to the result of
address@hidden / denominator}, truncated towards zero to an integer,
+and set @code{result["remainder"]} to the result of @samp{numerator %
+denominator}, truncated towards zero to an integer.  This function is
+primarily intended for use with arbitrary length integers; it avoids
+creating MPFR arbitrary precision floating-point values (@pxref{Arbitrary
+Precision Integers}).
+
+This function is a @code{gawk} extension.  It is not available in
+compatibility mode (@pxref{Options}).
+
 @item @code{log(@var{x})}
 @cindexawkfunc{log}
 @cindex logarithm
@@ -30205,27 +30205,30 @@ When dividing two arbitrary precision integers with 
either
 precision floating point value (unless the denominator evenly
 divides into the numerator).  In order to do integer division
 or remainder with arbitrary precision integers, use the built-in
address@hidden()} function (@pxref{Numeric Functions}).
address@hidden()} function (@pxref{Numeric Functions}).
 
-You can simulate the @code{div()} function in standard @command{awk}
+You can simulate the @code{intdiv()} function in standard @command{awk}
 using this user-defined function:
 
 @example
address@hidden file eg/lib/div.awk
-# div --- do integer division
address@hidden file eg/lib/intdiv.awk
+# intdiv --- do integer division
 
 @c endfile
 @ignore
address@hidden file eg/lib/div.awk
address@hidden file eg/lib/intdiv.awk
 #
 # Arnold Robbins, arnold@@skeeve.com, Public Domain
 # July, 2014
+#
+# Name changed from div() to intdiv()
+# April, 2015
 
 @c endfile
 
 @end ignore
address@hidden file eg/lib/div.awk
-function div(numerator, denominator, result)
address@hidden file eg/lib/intdiv.awk
+function intdiv(numerator, denominator, result)
 @{
     split("", result)
 
@@ -30240,7 +30243,7 @@ function div(numerator, denominator, result)
 @end example
 
 The following example program, contributed by Katie Wasserman,
-uses @code{div()} to
+uses @code{intdiv()} to
 compute the digits of @value{PI} to as many places as you
 choose to set:
 
@@ -30265,7 +30268,7 @@ BEGIN @{
     for (m = digits * 4; m > 0; --m) @{
         d = m * 2 + 1
         x = pi * m
-        div(x, d, result)
+        intdiv(x, d, result)
         pi = result["quotient"]
         pi = pi + two
     @}
@@ -35134,7 +35137,7 @@ functions for internationalization
 (@pxref{Programmer i18n})
 
 @item
-The @code{div()} function for doing integer
+The @code{intdiv()} function for doing integer
 division and remainder
 (@pxref{Numeric Functions})
 @end itemize
@@ -35915,7 +35918,7 @@ installed when @command{gawk} is built.
 @xref{Igawk Program}.
 
 @item
-The @code{div()} function.
+The @code{intdiv()} function.
 @xref{Numeric Functions}.
 
 @item
diff --git a/mpfr.c b/mpfr.c
index 571b334..080ed7f 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -1186,7 +1186,7 @@ do_mpfr_srand(int nargs)
        return res;
 }
 
-/* do_mpfr_div --- do integer division, return quotient and remainder in dest 
array */
+/* do_mpfr_intdiv --- do integer division, return quotient and remainder in 
dest array */
 
 /*
  * We define the semantics as:
@@ -1197,7 +1197,7 @@ do_mpfr_srand(int nargs)
  */
 
 NODE *
-do_mpfr_div(int nargs)
+do_mpfr_intdiv(int nargs)
 {
        NODE *numerator, *denominator, *result;
        NODE *num, *denom;
@@ -1206,7 +1206,7 @@ do_mpfr_div(int nargs)
 
        result = POP_PARAM();
        if (result->type != Node_var_array)
-               fatal(_("div: third argument is not an array"));
+               fatal(_("intdiv: third argument is not an array"));
        assoc_clear(result);
 
        denominator = POP_SCALAR();
@@ -1214,9 +1214,9 @@ do_mpfr_div(int nargs)
 
        if (do_lint) {
                if ((numerator->flags & (NUMCUR|NUMBER)) == 0)
-                       lintwarn(_("div: received non-numeric first argument"));
+                       lintwarn(_("intdiv: received non-numeric first 
argument"));
                if ((denominator->flags & (NUMCUR|NUMBER)) == 0)
-                       lintwarn(_("div: received non-numeric second 
argument"));
+                       lintwarn(_("intdiv: received non-numeric second 
argument"));
        }
 
        (void) force_number(numerator);
@@ -1250,7 +1250,7 @@ do_mpfr_div(int nargs)
        }
 
        if (mpz_sgn(denom->mpg_i) == 0)
-               fatal(_("div: division by zero attempted"));
+               fatal(_("intdiv: division by zero attempted"));
 
        quotient = mpg_integer();
        remainder = mpg_integer();
diff --git a/test/ChangeLog b/test/ChangeLog
index 0c21218..f9e4994 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
+2015-04-02         Arnold D. Robbins     <address@hidden>
+
+       * id.ok, mpfrsqrt.awk: Update after rename of div() --> intdiv().
+
 2015-03-31         Arnold D. Robbins     <address@hidden>
 
        * Makefile.am (indirectbuiltin): New test.
diff --git a/test/id.ok b/test/id.ok
index b5baf15..bd26b47 100644
--- a/test/id.ok
+++ b/test/id.ok
@@ -24,7 +24,6 @@ cos -> builtin
 TEXTDOMAIN -> scalar
 ORS -> scalar
 split -> builtin
-div -> builtin
 RSTART -> scalar
 compl -> builtin
 bindtextdomain -> builtin
@@ -63,6 +62,7 @@ sub -> builtin
 OFMT -> scalar
 RLENGTH -> scalar
 substr -> builtin
+intdiv -> builtin
 FPAT -> scalar
 RS -> scalar
 xor -> builtin
diff --git a/test/mpfrsqrt.awk b/test/mpfrsqrt.awk
index 23a15c9..3fb1f5f 100644
--- a/test/mpfrsqrt.awk
+++ b/test/mpfrsqrt.awk
@@ -14,7 +14,7 @@ a=11111111111111111111111111111111111111111111111111111111111
 print sqrt(a^2)
 #print sq_root(a^2)
 
-# ADR: Added for gawk-4.1-stable which doesn't have built-in div() function
+# ADR: Added for gawk-4.1-stable which doesn't have built-in intdiv() function
 if (PROCINFO["version"] < "4.1.60")
   print sq_root2(a^2)
 else
@@ -27,9 +27,9 @@ function sq_root(x, temp,r,z)
    z=0
    while (abs(z-temp)>1)
     { z=temp
-      div(x,temp,r)
+      intdiv(x,temp,r)
       temp=r["quotient"] + temp
-      div(temp,2,r)
+      intdiv(temp,2,r)
       temp=r["quotient"]
     }
    return temp

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                             |    9 +
 awk.h                                 |    4 +-
 awkgram.c                             |    6 +-
 awkgram.y                             |    6 +-
 awklib/eg/lib/{div.awk => intdiv.awk} |    7 +-
 awklib/eg/prog/pi.awk                 |    2 +-
 builtin.c                             |   12 +-
 doc/ChangeLog                         |    4 +
 doc/awkcard.in                        |    6 +-
 doc/gawk.1                            |   16 +-
 doc/gawk.info                         |  711 +++++++++++++++++----------------
 doc/gawk.texi                         |   59 ++--
 doc/gawktexi.in                       |   59 ++--
 mpfr.c                                |   12 +-
 test/ChangeLog                        |    4 +
 test/id.ok                            |    2 +-
 test/mpfrsqrt.awk                     |    6 +-
 17 files changed, 476 insertions(+), 449 deletions(-)
 rename awklib/eg/lib/{div.awk => intdiv.awk} (67%)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]