This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [patch] intrinsic.texi: 13 down
- From: Daniel Franke <franke dot daniel at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Date: Sat, 26 Aug 2006 13:08:29 +0200
- Subject: Re: [patch] intrinsic.texi: 13 down
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:message-id:content-type; b=FO8n6tPu854l3AttOJPkvnRePugq0gNOQu/St5YiBvxtk1k5dveUnEfE3sQdN8IBCi5FI8d7KvT+BiQX4PXn5ICKViwEdICJy9GkTM9m99lD1OJlB20FPkSlolW/D/HPfDcrrwUWawdejeuFKeVITV/vTpLpJ0FgLLhsHBRzv+k=
- References: <200608252209.13208.franke.daniel@gmail.com> <44EF780F.3050903@stanford.edu> <20060825225550.GA73280@troutmask.apl.washington.edu>
On Saturday 26 August 2006 00:55, Steve Kargl wrote:
> On Fri, Aug 25, 2006 at 03:22:07PM -0700, Brooks Moses wrote:
> > Hexadecimal constants in the code examples should probably be entered in
> > as close to a standard form as possible -- i.e., Z'F', not 'F'X. I am
> > not sure whether it's worth going completely with standard code and
> > putting them in DATA statements rather than assignments, but it may be.
>
> I agree with Brooks on this point. We should be encouraging
> the use of standard conforming Fortran.
Changed
INTEGER :: a = 'F'X, b = '3'X
to
INTEGER :: a, b
DATA a / 'F'Z /, b / '3'Z /
Googled for this. Obviously I chose the wrong link.
On Saturday 26 August 2006 00:22, Brooks Moses wrote:
> In the documentation of ATANH, the description states that the magnitude
> of X shall be less than one, but the code example uses values that have
> magnitudes equal to one. Is the description or the example in error?
"write(*,*) atanh(1.0)" gives "+Infinity". Although the limiting value is
correct, one may argue whether this is a useful result. To be consistent with
the actual implementation, I changed the wording to "less than or equal to
one" and the range to "-\infty \leq \atanh (x) \leq \infty".
> > The FGETC and related functions are described as relating to files in
> > stream mode, and referring to "Stream I/O". Is this the same stream
> > mode and "Stream I/O" as what's in the Fortran 2003 standard (and
> > recently added to gfortran), or is this different? In particular, I
> > note that the OPEN statements in the code examples do not specify
> > ACCESS='STREAM'. If this is not the same thing, this should probably be
> > reworded to avoid confusion.
>
> The FGETC function and friends are for g77 compatibility. These
> allowed "stream I/O" in Fortran 77 programs, and are essentially
> independent of F2003 Stream I/0. We should probably add a sentence
> or two to encourage the use of F2003 Stream I/O over the nonstandard
> intrinsics.
>
> "The FGETC intrinsic routine is provided for backwards compatibility
> with GNU Fortran 77. @command{Gfortran} provides the Fortran 2003
> Stream facility. Programmers should consider the use of new stream
> IO feature in new code for future portability."
>
> Feel free to hack on the above and add a cross reference if possible.
The paragraph below was added to the description of FGET, FGETC,
FPUT and FPUTC:
"This intrinsic routine is provided for backwards compatibility with
GNU Fortran 77. @command{Gfortran} provides the Fortran 2003 Stream facility.
Programmers should consider the use of new stream IO feature in new code
for future portability. See also @ref{Fortran 2003 status}."
While at it, I included the XOR intrinsic in this patch and extended the
description of AND, OR and XOR by:
"This intrinsic routine is provided for backwards compatibility with
GNU Fortran 77. In new code, programmers should consider to use the
@ref{xxx} intrinsic defined by the F95 standard."
where xxx is one of { IAND, IOR, IEOR }.
Tested info, dvi and html targets on x86.
* intrinsic.texi: added documentation for ACOSH, AND, ASINH,
ATANH, CHDIR, FGET, FGETC, FPUT, FPUTC, GETCWD, OR and XOR
intrinsics, removed inadvertently introduced doc-stubs for
EQV and NEQV, corrected some typographical errors.
Regards
Daniel
Index: intrinsic.texi
===================================================================
--- intrinsic.texi (revision 116382)
+++ intrinsic.texi (working copy)
@@ -24,6 +24,16 @@
@end ignore
+@tex
+\gdef\acos{\mathop{\rm acos}\nolimits}
+\gdef\asin{\mathop{\rm asin}\nolimits}
+\gdef\atan{\mathop{\rm atan}\nolimits}
+\gdef\acosh{\mathop{\rm acosh}\nolimits}
+\gdef\asinh{\mathop{\rm asinh}\nolimits}
+\gdef\atanh{\mathop{\rm atanh}\nolimits}
+@end tex
+
+
@node Intrinsic Procedures
@chapter Intrinsic Procedures
@cindex Intrinsic Procedures
@@ -49,7 +59,7 @@
* @code{ALARM}: ALARM, Set an alarm clock
* @code{ALL}: ALL, Determine if all values are true
* @code{ALLOCATED}: ALLOCATED, Status of allocatable entity
-* @code{AND}: AND, Logical and
+* @code{AND}: AND, Bitwise logical AND
* @code{ANINT}: ANINT, Nearest whole number
* @code{ANY}: ANY, Determine if any values are true
* @code{ASIN}: ASIN, Arcsine function
@@ -75,7 +85,7 @@
* @code{CONJG}: CONJG, Complex conjugate function
* @code{COS}: COS, Cosine function
* @code{COSH}: COSH, Hyperbolic cosine function
-* @code{COUNT}: COUNT, Count occurrences of .TRUE. in an array
+* @code{COUNT}: COUNT, Count occurrences of TRUE in an array
* @code{CPU_TIME}: CPU_TIME, CPU time subroutine
* @code{CSHIFT}: CSHIFT, Circular array shift function
* @code{CTIME}: CTIME, Subroutine (or function) to convert a time into a string
@@ -91,7 +101,6 @@
* @code{DTIME}: DTIME, Execution time subroutine (or function)
* @code{EOSHIFT}: EOSHIFT, End-off shift function
* @code{EPSILON}: EPSILON, Epsilon function
-* @code{EQV}: EQV, Logical equivalence
* @code{ERF}: ERF, Error function
* @code{ERFC}: ERFC, Complementary error function
* @code{ETIME}: ETIME, Execution time subroutine (or function)
@@ -99,13 +108,13 @@
* @code{EXP}: EXP, Exponential function
* @code{EXPONENT}: EXPONENT, Exponent function
* @code{FDATE}: FDATE, Subroutine (or function) to get the current time as a string
-* @code{FGET}: FGET, Read a single character from stdin in stream mode
+* @code{FGET}: FGET, Read a single character in stream mode from stdin
* @code{FGETC}: FGETC, Read a single character in stream mode
* @code{FLOAT}: FLOAT, Convert integer to default real
* @code{FLOOR}: FLOOR, Integer floor function
* @code{FLUSH}: FLUSH, Flush I/O unit(s)
* @code{FNUM}: FNUM, File number function
-* @code{FPUT}: FPUT, Write a single character to stdout in stream mode
+* @code{FPUT}: FPUT, Write a single character in stream mode to stdout
* @code{FPUTC}: FPUTC, Write a single character in stream mode
* @code{FRACTION}: FRACTION, Fractional part of the model representation
* @code{FREE}: FREE, Memory de-allocation subroutine
@@ -174,11 +183,10 @@
* @code{MODULO}: MODULO, Modulo function
* @code{MVBITS}: MVBITS, Move bits from one integer to another
* @code{NEAREST}: NEAREST, Nearest representable number
-* @code{NEQV}: NEQV, Logical non-equivalence
* @code{NINT}: NINT, Nearest whole number
* @code{NOT}: NOT, Logical negation
* @code{NULL}: NULL, Function that returns an dissassociated pointer
-* @code{OR}: OR, Logical inclusive disjunction
+* @code{OR}: OR, Bitwise logical OR
* @code{PACK}: PACK, Pack an array into an array of rank one
* @code{PERROR}: PERROR, Print system error message
* @code{PRECISION}: PRECISION, Decimal precision of a real kind
@@ -233,7 +241,7 @@
* @code{UNMASK}: UNMASK, (?)
* @code{UNPACK}: UNPACK, Unpack an array of rank one into an array
* @code{VERIFY}: VERIFY, Scan a string for the absence of a set of characters
-* @code{XOR}: XOR, Logical exclusive or
+* @code{XOR}: XOR, Bitwise logical exclusive or
@end menu
@node Introduction
@@ -445,7 +453,7 @@
@table @asis
@item @emph{Description}:
-@code{ACOS(X)} computes the arccosine of @var{X} (inverse of @code{COS(X)}.
+@code{ACOS(X)} computes the arccosine of @var{X} (inverse of @code{COS(X)}).
@item @emph{Standard}:
F77 and later
@@ -464,8 +472,8 @@
@item @emph{Return value}:
The return value is of type @code{REAL(*)} and it lies in the
-range @math{ 0 \leq \arccos (x) \leq \pi}. The kind type
-parameter is the same as @var{X}.
+range @math{ 0 \leq \acos(x) \leq \pi}. The kind type parameter
+is the same as @var{X}.
@item @emph{Example}:
@smallexample
@@ -493,17 +501,37 @@
@cindex hyperbolic arccosine
@cindex hyperbolic cosine (inverse)
-Intrinsic implemented, documentation pending.
-
@table @asis
@item @emph{Description}:
+@code{ACOSH(X)} computes the area hyperbolic cosine of @var{X} (inverse of @code{COSH(X)}).
+
@item @emph{Standard}:
+GNU extension
+
@item @emph{Class}:
+Elemental function
+
@item @emph{Syntax}:
+@code{X = ACOSH(X)}
+
@item @emph{Arguments}:
+@multitable @columnfractions .15 .80
+@item @var{X} @tab The type shall be @code{REAL(*)} with a magnitude that is
+greater or equal to one.
+@end multitable
+
@item @emph{Return value}:
+The return value is of type @code{REAL(*)} and it lies in the
+range @math{0 \leq \acosh (x) \leq \infty}.
+
@item @emph{Example}:
-@item @emph{Specific names}:
+@smallexample
+PROGRAM test_acosh
+ REAL(8), DIMENSION(3) :: x = (/ 1.0, 2.0, 3.0 /)
+ WRITE (*,*) ACOSH(x)
+END PROGRAM
+@end smallexample
+
@item @emph{See also}:
Inverse function: @ref{COSH}
@end table
@@ -861,22 +889,51 @@
@node AND
-@section @code{AND} --- Logical and
+@section @code{AND} --- Bitwise logical AND
@findex @code{AND} intrinsic
-@cindex logical operations
+@cindex bit operations
-Intrinsic implemented, documentation pending.
-
@table @asis
@item @emph{Description}:
+Bitwise logical @code{AND}.
+
+This intrinsic routine is provided for backwards compatibility with
+GNU Fortran 77. In new code, programmers should consider to use the
+@ref{IAND} intrinsic defined by the F95 standard.
+
@item @emph{Standard}:
+GNU extension
+
@item @emph{Class}:
+Non-elemental function
+
@item @emph{Syntax}:
+@code{RESULT = AND(X, Y)}
+
@item @emph{Arguments}:
+@multitable @columnfractions .15 .80
+@item @var{X} @tab The type shall be either @code{INTEGER(*)} or @code{LOGICAL}.
+@item @var{Y} @tab The type shall be either @code{INTEGER(*)} or @code{LOGICAL}.
+@end multitable
+
@item @emph{Return value}:
+The return type of @var{RESULT} is either @code{INTEGER(*)} or @code{LOGICAL},
+it corresponds to that of @var{X} and @var{Y}.
+
@item @emph{Example}:
-@item @emph{Specific names}:
+@smallexample
+PROGRAM test_and
+ LOGICAL :: T = .TRUE., F = ..FALSE.
+ INTEGER :: a, b
+ DATA a / 'F'Z /, b / '3'Z /
+
+ WRITE (*,*) AND(T, T), AND(T, F), AND(F, T), AND(F, F)
+ WRITE (*,*) AND(a, b)
+END PROGRAM
+@end smallexample
+
@item @emph{See also}:
+F95 elemental function: @ref{IAND}
@end table
@@ -1011,7 +1068,7 @@
@table @asis
@item @emph{Description}:
-@code{ASIN(X)} computes the arcsine of its @var{X}.
+@code{ASIN(X)} computes the arcsine of its @var{X} (inverse of @code{SIN(X)}).
@item @emph{Standard}:
F77 and later
@@ -1030,7 +1087,7 @@
@item @emph{Return value}:
The return value is of type @code{REAL(*)} and it lies in the
-range @math{-\pi / 2 \leq \arcsin (x) \leq \pi / 2}. The kind type
+range @math{-\pi / 2 \leq \asin (x) \leq \pi / 2}. The kind type
parameter is the same as @var{X}.
@item @emph{Example}:
@@ -1059,18 +1116,38 @@
@cindex hyperbolic arcsine
@cindex hyperbolic sine (inverse)
-Intrinsic implemented, documentation pending.
-
@table @asis
@item @emph{Description}:
+@code{ASINH(X)} computes the area hyperbolic sine of @var{X} (inverse of @code{SINH(X)}).
+
@item @emph{Standard}:
+GNU extension
+
@item @emph{Class}:
+Elemental function
+
@item @emph{Syntax}:
+@code{X = ASINH(X)}
+
@item @emph{Arguments}:
+@multitable @columnfractions .15 .80
+@item @var{X} @tab The type shall be @code{REAL(*)}, with @var{X} a real number.
+@end multitable
+
@item @emph{Return value}:
+The return value is of type @code{REAL(*)} and it lies in the
+range @math{-\infty \leq \asinh (x) \leq \infty}.
+
@item @emph{Example}:
-@item @emph{Specific names}:
+@smallexample
+PROGRAM test_asinh
+ REAL(8), DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /)
+ WRITE (*,*) ASINH(x)
+END PROGRAM
+@end smallexample
+
@item @emph{See also}:
+Inverse function: @ref{SINH}
@end table
@@ -1177,7 +1254,7 @@
@item @emph{Return value}:
The return value is of type @code{REAL(*)} and it lies in the
-range @math{ - \pi / 2 \leq \arcsin (x) \leq \pi / 2}.
+range @math{ - \pi / 2 \leq \atan (x) \leq \pi / 2}.
@item @emph{Example}:
@smallexample
@@ -1229,7 +1306,7 @@
@item @emph{Return value}:
The return value has the same type and kind type parameter as @var{Y}.
It is the principal value of the complex number @math{X + i Y}. If
-@var{X} is nonzero, then it lies in the range @math{-\pi \le \arccos (x) \leq \pi}.
+@var{X} is nonzero, then it lies in the range @math{-\pi \le \atan (x) \leq \pi}.
The sign is positive if @var{Y} is positive. If @var{Y} is zero, then
the return value is zero if @var{X} is positive and @math{\pi} if @var{X}
is negative. Finally, if @var{X} is zero, then the magnitude of the result
@@ -1258,18 +1335,38 @@
@cindex hyperbolic arctangent
@cindex hyperbolic tangent (inverse)
-Intrinsic implemented, documentation pending.
-
@table @asis
@item @emph{Description}:
+@code{ATANH(X)} computes the area hyperbolic sine of @var{X} (inverse of @code{TANH(X)}).
+
@item @emph{Standard}:
+GNU extension
+
@item @emph{Class}:
+Elemtal function
+
@item @emph{Syntax}:
+@code{X = ATANH(X)}
+
@item @emph{Arguments}:
+@multitable @columnfractions .15 .80
+@item @var{X} @tab The type shall be @code{REAL(*)} with a magnitude that is less than or equal to one.
+@end multitable
+
@item @emph{Return value}:
+The return value is of type @code{REAL(*)} and it lies in the
+range @math{-\infty \leq \atanh(x) \leq \infty}.
+
@item @emph{Example}:
-@item @emph{Specific names}:
+@smallexample
+PROGRAM test_atanh
+ REAL, DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /)
+ WRITE (*,*) ATANH(x)
+END PROGRAM
+@end smallexample
+
@item @emph{See also}:
+Inverse function: @ref{TANH}
@end table
@@ -1727,21 +1824,44 @@
@findex @code{CHDIR} intrinsic
@cindex file system functions
-Intrinsic implemented, documentation pending.
-
@table @asis
@item @emph{Description}:
+Change current working directory to a specified @var{PATH}.
+
@item @emph{Standard}:
+GNU extension
+
@item @emph{Class}:
+Non-elemental subroutine
+
@item @emph{Syntax}:
+@code{CALL chdir(PATH[,STATUS])}
+
@item @emph{Arguments}:
-@item @emph{Return value}:
+@multitable @columnfractions .15 .80
+@item @var{PATH} @tab The type shall be @code{CHARACTER(*)} and shall specfiy a valid path within the file system.
+@item @var{STATUS} @tab (Optional) status flag. Returns 0 on success,
+ a system specific and non-zero error code otherwise.
+@end multitable
+
@item @emph{Example}:
-@item @emph{Specific names}:
+@smallexample
+PROGRAM test_chdir
+ CHARACTER(len=255) :: path
+ CALL getcwd(path)
+ WRITE(*,*) TRIM(path)
+ CALL chdir("/tmp")
+ CALL getcwd(path)
+ WRITE(*,*) TRIM(path)
+END PROGRAM
+@end smallexample
+
@item @emph{See also}:
+@ref{GETCWD}
@end table
+
@node CHMOD
@section @code{CHMOD} --- Change access permissions of files
@findex @code{CHMOD}
@@ -2819,30 +2939,6 @@
-@node EQV
-@section @code{EQV} --- Logical equivalence
-@findex @code{EQV} intrinsic
-@cindex logical operations
-
-Intrinsic implemented, documentation pending.
-
-@table @asis
-@item @emph{Description}:
-@item @emph{Standard}:
-F77 and later
-
-@item @emph{Class}:
-@item @emph{Syntax}:
-@item @emph{Arguments}:
-@item @emph{Return value}:
-@item @emph{Example}:
-@item @emph{Specific names}:
-@item @emph{See also}:
-@ref{NEQV}
-@end table
-
-
-
@node ERF
@section @code{ERF} --- Error function
@findex @code{ERF} intrinsic
@@ -3234,51 +3330,117 @@
-@node FGETC
-@section @code{FGETC} --- Read a single character in stream mode
-@findex @code{FGETC} intrinsic
-@cindex undocumented intrinsic
+@node FGET
+@section @code{FGET} --- Read a single character in stream mode from stdin
+@findex @code{FGET} intrinsic
+@cindex file operations
+@cindex stream operations
-Intrinsic implemented, documentation pending.
-
@table @asis
@item @emph{Description}:
+Read a single character in stream mode from stdin by bypassing normal
+formatted output. Stream I/O should not be mixed with normal record-oriented
+(formatted or unformatted) I/O on the same unit; the results are unpredictable.
+
+This intrinsic routine is provided for backwards compatibility with
+GNU Fortran 77. @command{Gfortran} provides the Fortran 2003 Stream facility.
+Programmers should consider the use of new stream IO feature in new code
+for future portability. See also @ref{Fortran 2003 status}.
+
@item @emph{Standard}:
GNU extension
@item @emph{Class}:
+Non-elemental subroutine
+
@item @emph{Syntax}:
+@code{CALL fget(C[,STATUS])}
+
@item @emph{Arguments}:
-@item @emph{Return value}:
+@multitable @columnfractions .15 .80
+@item @var{C} @tab The type shall be @code{CHARACTER}.
+@item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER}. Returns 0 on success,
+ -1 on end-of-file and a system specific positive error code otherwise.
+@end multitable
+
@item @emph{Example}:
-@item @emph{Specific names}:
+@smallexample
+PROGRAM test_fget
+ INTEGER, PARAMETER :: strlen = 100
+ INTEGER :: status, i = 1
+ CHARACTER(len=strlen) :: str = ""
+
+ WRITE (*,*) 'Enter text:'
+ DO
+ CALL fget(str(i:i), status)
+ if (status /= 0 .OR. i > strlen) exit
+ i = i + 1
+ END DO
+ WRITE (*,*) TRIM(str)
+END PROGRAM
+@end smallexample
+
@item @emph{See also}:
+@ref{FGETC}, @ref{FPUT}, @ref{FPUTC}
@end table
+@node FGETC
+@section @code{FGETC} --- Read a single character in stream mode
+@findex @code{FGETC} intrinsic
+@cindex file operations
+@cindex stream operations
-@node FGET
-@section @code{FGET} --- Read a single character from stdin in stream mode
-@findex @code{FGET} intrinsic
-@cindex undocumented intrinsic
+@table @asis
+@item @emph{Description}:
+Read a single character in stream mode by bypassing normal formatted output.
+Stream I/O should not be mixed with normal record-oriented (formatted or
+unformatted) I/O on the same unit; the results are unpredictable.
-Intrinsic implemented, documentation pending.
+This intrinsic routine is provided for backwards compatibility with
+GNU Fortran 77. @command{Gfortran} provides the Fortran 2003 Stream facility.
+Programmers should consider the use of new stream IO feature in new code
+for future portability. See also @ref{Fortran 2003 status}.
-@table @asis
-@item @emph{Description}:
@item @emph{Standard}:
GNU extension
@item @emph{Class}:
+Non-elemental subroutine
+
@item @emph{Syntax}:
+@code{CALL fgetc(UNIT,C[,STATUS])}
+
@item @emph{Arguments}:
-@item @emph{Return value}:
+@multitable @columnfractions .15 .80
+@item @var{UNIT} @tab The type shall be @code{INTEGER}.
+@item @var{C} @tab The type shall be @code{CHARACTER}.
+@item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER}. Returns 0 on success,
+ -1 on end-of-file and a system specific positive error code otherwise.
+@end multitable
+
@item @emph{Example}:
-@item @emph{Specific names}:
+@smallexample
+PROGRAM test_fgetc
+ INTEGER :: fd = 42, status
+ CHARACTER :: c
+
+ OPEN(UNIT=fd, FILE="/etc/passwd", ACTION="READ", STATUS = "OLD")
+ DO
+ CALL fgetc(fd, c, status)
+ IF (status /= 0) EXIT
+ call fput(c)
+ END DO
+ CLOSE(UNIT=fd)
+END PROGRAM
+@end smallexample
+
@item @emph{See also}:
+@ref{FGET}, @ref{FPUT}, @ref{FPUTC}
@end table
+
@node FLOOR
@section @code{FLOOR} --- Integer floor function
@findex @code{FLOOR} intrinsic
@@ -3397,24 +3559,51 @@
@node FPUT
-@section @code{FPUT} --- Write a single character to stdout in stream mode
+@section @code{FPUT} --- Write a single character in stream mode to stdout
@findex @code{FPUT} intrinsic
-@cindex undocumented intrinsic
+@cindex file operations
+@cindex stream operations
-Intrinsic implemented, documentation pending.
-
@table @asis
@item @emph{Description}:
+Write a single character in stream mode to stdout by bypassing normal
+formatted output. Stream I/O should not be mixed with normal record-oriented
+(formatted or unformatted) I/O on the same unit; the results are unpredictable.
+
+This intrinsic routine is provided for backwards compatibility with
+GNU Fortran 77. @command{Gfortran} provides the Fortran 2003 Stream facility.
+Programmers should consider the use of new stream IO feature in new code
+for future portability. See also @ref{Fortran 2003 status}.
+
@item @emph{Standard}:
GNU extension
@item @emph{Class}:
+Non-elemental subroutine
+
@item @emph{Syntax}:
+@code{CALL fput(C[,STATUS])}
+
@item @emph{Arguments}:
-@item @emph{Return value}:
+@multitable @columnfractions .15 .80
+@item @var{C} @tab The type shall be @code{CHARACTER}.
+@item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER}. Returns 0 on success,
+ -1 on end-of-file and a system specific positive error code otherwise.
+@end multitable
+
@item @emph{Example}:
-@item @emph{Specific names}:
+@smallexample
+PROGRAM test_fput
+ CHARACTER(len=*) :: str = "gfortran"
+ INTEGER :: i
+ DO i = 1, len_trim(str)
+ CALL fput(str(i:i))
+ END DO
+END PROGRAM
+@end smallexample
+
@item @emph{See also}:
+@ref{FPUTC}, @ref{FGET}, @ref{FGETC}
@end table
@@ -3422,22 +3611,53 @@
@node FPUTC
@section @code{FPUTC} --- Write a single character in stream mode
@findex @code{FPUTC} intrinsic
-@cindex undocumented intrinsic
+@cindex file operations
+@cindex stream operations
-Intrinsic implemented, documentation pending.
-
@table @asis
@item @emph{Description}:
+Write a single character in stream mode by bypassing normal formatted
+output. Stream I/O should not be mixed with normal record-oriented
+(formatted or unformatted) I/O on the same unit; the results are unpredictable.
+
+This intrinsic routine is provided for backwards compatibility with
+GNU Fortran 77. @command{Gfortran} provides the Fortran 2003 Stream facility.
+Programmers should consider the use of new stream IO feature in new code
+for future portability. See also @ref{Fortran 2003 status}.
+
@item @emph{Standard}:
GNU extension
@item @emph{Class}:
+Non-elemental subroutine
+
@item @emph{Syntax}:
+@code{CALL fputc(UNIT,C[,STATUS])}
+
@item @emph{Arguments}:
-@item @emph{Return value}:
+@multitable @columnfractions .15 .80
+@item @var{UNIT} @tab The type shall be @code{INTEGER}.
+@item @var{C} @tab The type shall be @code{CHARACTER}.
+@item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER}. Returns 0 on success,
+ -1 on end-of-file and a system specific positive error code otherwise.
+@end multitable
+
@item @emph{Example}:
-@item @emph{Specific names}:
+@smallexample
+PROGRAM test_fputc
+ CHARACTER(len=*) :: str = "gfortran"
+ INTEGER :: fd = 42, i
+
+ OPEN(UNIT = fd, FILE = "out", ACTION = "WRITE", STATUS="NEW")
+ DO i = 1, len_trim(str)
+ CALL fputc(fd, str(i:i))
+ END DO
+ CLOSE(fd)
+END PROGRAM
+@end smallexample
+
@item @emph{See also}:
+@ref{FPUT}, @ref{FGET}, @ref{FGETC}
@end table
@@ -3674,22 +3894,39 @@
@node GETCWD
@section @code{GETCWD} --- Get current working directory
@findex @code{GETCWD} intrinsic
-@cindex undocumented intrinsic
+@cindex file system functions
-Intrinsic implemented, documentation pending.
-
@table @asis
@item @emph{Description}:
+Get current working directory.
+
@item @emph{Standard}:
GNU extension
@item @emph{Class}:
+Non-elemental subroutine.
+
@item @emph{Syntax}:
+@code{CALL getcwd(CWD[,STATUS])}
+
@item @emph{Arguments}:
-@item @emph{Return value}:
+@multitable @columnfractions .15 .80
+@item @var{CWD} @tab The type shall be @code{CHARACTER(*)}.
+@item @var{STATUS} @tab (Optional) status flag. Returns 0 on success,
+ a system specific and non-zero error code otherwise.
+@end multitable
+
@item @emph{Example}:
-@item @emph{Specific names}:
+@smallexample
+PROGRAM test_getcwd
+ CHARACTER(len=255) :: cwd
+ CALL getcwd(cwd)
+ WRITE(*,*) TRIM(cwd)
+END PROGRAM
+@end smallexample
+
@item @emph{See also}:
+@ref{CHDIR}
@end table
@@ -5642,31 +5879,6 @@
-@node NEQV
-@section @code{NEQV} --- Logical non-equivalence
-@findex @code{NEQV} intrinsic
-@cindex logical operations
-
-Intrinsic implemented, documentation pending.
-
-@table @asis
-@item @emph{Description}:
-@item @emph{Standard}:
-F77 and later
-
-@item @emph{Class}:
-@item @emph{Syntax}:
-@item @emph{Arguments}:
-@item @emph{Return value}:
-@item @emph{Example}:
-@item @emph{Specific names}:
-@item @emph{See also}:
-@ref{EQV}
-@end table
-
-
-
-
@node NINT
@section @code{NINT} --- Nearest whole number
@findex @code{NINT} intrinsic
@@ -5771,23 +5983,51 @@
@node OR
-@section @code{OR} --- Logical inclusive disjunction
+@section @code{OR} --- Bitwise logical OR
@findex @code{OR} intrinsic
-@cindex logical operations
+@cindex bit operations
-Intrinsic implemented, documentation pending.
-
@table @asis
@item @emph{Description}:
+Bitwise logical @code{OR}.
+
+This intrinsic routine is provided for backwards compatibility with
+GNU Fortran 77. In new code, programmers should consider to use the
+@ref{IOR} intrinsic defined by the F95 standard.
+
@item @emph{Standard}:
-F77 and later
+GNU extension
@item @emph{Class}:
+Non-elemental function
+
@item @emph{Syntax}:
+@code{RESULT = OR(X, Y)}
+
@item @emph{Arguments}:
+@multitable @columnfractions .15 .80
+@item @var{X} @tab The type shall be either @code{INTEGER(*)} or @code{LOGICAL}.
+@item @var{Y} @tab The type shall be either @code{INTEGER(*)} or @code{LOGICAL}.
+@end multitable
+
@item @emph{Return value}:
+The return type of @var{RESULT} is either @code{INTEGER(*)} or @code{LOGICAL},
+it corresponds to that of @var{X} and @var{Y}.
+
@item @emph{Example}:
+@smallexample
+PROGRAM test_or
+ LOGICAL :: T = .TRUE., F = ..FALSE.
+ INTEGER :: a, b
+ DATA a / 'F'Z /, b / '3'Z /
+
+ WRITE (*,*) OR(T, T), OR(T, F), OR(F, T), OR(F, F)
+ WRITE (*,*) OR(a, b)
+END PROGRAM
+@end smallexample
+
@item @emph{See also}:
+F95 elemental function: @ref{IOR}
@end table
@@ -7552,24 +7792,51 @@
@node XOR
-@section @code{XOR} --- Logical exclusive or
+@section @code{XOR} --- Bitwise logical exclusive or
@findex @code{XOR} intrinsic
-@cindex logical operations
+@cindex bit operations
-Intrinsic implemented, documentation pending.
-
@table @asis
@item @emph{Description}:
+Bitwise logical exclusive or.
+
+This intrinsic routine is provided for backwards compatibility with
+GNU Fortran 77. In new code, programmers should consider to use the
+@ref{IEOR} intrinsic defined by the F95 standard.
+
@item @emph{Standard}:
-F77 and later
+GNU extension
@item @emph{Class}:
+Non-elemental function
+
@item @emph{Syntax}:
+@code{RESULT = XOR(X, Y)}
+
@item @emph{Arguments}:
+@multitable @columnfractions .15 .80
+@item @var{X} @tab The type shall be either @code{INTEGER(*)} or @code{LOGICAL}.
+@item @var{Y} @tab The type shall be either @code{INTEGER(*)} or @code{LOGICAL}.
+@end multitable
+
@item @emph{Return value}:
+The return type of @var{RESULT} is either @code{INTEGER(*)} or @code{LOGICAL},
+it corresponds to that of @var{X} and @var{Y}.
+
@item @emph{Example}:
-@item @emph{Specific names}:
+@smallexample
+PROGRAM test_xor
+ LOGICAL :: T = .TRUE., F = ..FALSE.
+ INTEGER :: a, b
+ DATA a / 'F'Z /, b / '3'Z /
+
+ WRITE (*,*) XOR(T, T), XOR(T, F), XOR(F, T), XOR(F, F)
+ WRITE (*,*) XOR(a, b)
+END PROGRAM
+@end smallexample
+
@item @emph{See also}:
+F95 elemental function: @ref{IEOR}
@end table