@ignore
-Copyright (C) 2005
+Copyright (C) 2005, 2006
Free Software Foundation, Inc.
This is part of the GFORTRAN manual.
For copying conditions, see the file gfortran.texi.
@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
* @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
* @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
* @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)
* @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
* @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{NULL}: NULL, Function that returns an disassociated pointer
+* @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
* @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
@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
@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
@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
@node AND
-@section @code{AND} --- Logical and
+@section @code{AND} --- Bitwise logical AND
@findex @code{AND} intrinsic
-@cindex logical operations
-
-Intrinsic implemented, documentation pending.
+@cindex bit operations
@table @asis
@item @emph{Description}:
+Bitwise logical @code{AND}.
+
+This intrinsic routine is provided for backwards compatibility with
+GNU Fortran 77. For integer arguments, programmers should consider
+the use of the @ref{IAND} intrinsic defined by the Fortran 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 is either @code{INTEGER(*)} or @code{LOGICAL} after
+cross-promotion of the arguments.
+
@item @emph{Example}:
-@item @emph{Specific names}:
+@smallexample
+PROGRAM test_and
+ LOGICAL :: T = .TRUE., F = ..FALSE.
+ INTEGER :: a, b
+ DATA a / Z'F' /, b / Z'3' /
+
+ 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
@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
@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}:
@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
@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
@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
@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}:
+Elemental 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
@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 specify 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}
@item @tab @code{VALUE(1)}: @tab The year
@item @tab @code{VALUE(2)}: @tab The month
@item @tab @code{VALUE(3)}: @tab The day of the month
-@item @tab @code{VAlUE(4)}: @tab Time difference with UTC in minutes
+@item @tab @code{VALUE(4)}: @tab Time difference with UTC in minutes
@item @tab @code{VALUE(5)}: @tab The hour of the day
@item @tab @code{VALUE(6)}: @tab The minutes of the hour
@item @tab @code{VALUE(7)}: @tab The seconds of the minute
previous invocation.
On some systems, the underlying timings are represented using types with
-sufficiently small limits that overflows (wraparounds) are possible, such as
+sufficiently small limits that overflows (wrap around) are possible, such as
32-bit types. Therefore, the values returned by this intrinsic might be, or
become, negative, or numerically less than previous values, during a single
run of the compiled program.
-@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
@code{TARRAY(2)} respectively. @var{RESULT} is equal to @code{TARRAY(1) + TARRAY(2)}.
On some systems, the underlying timings are represented using types with
-sufficiently small limits that overflows (wraparounds) are possible, such as
+sufficiently small limits that overflows (wrap around) are possible, such as
32-bit types. Therefore, the values returned by this intrinsic might be, or
become, negative, or numerically less than previous values, during a single
run of the compiled program.
-@node FGETC
-@section @code{FGETC} --- Read a single character in stream mode
-@findex @code{FGETC} intrinsic
-@cindex undocumented intrinsic
-
-Intrinsic implemented, documentation pending.
+@node FGET
+@section @code{FGET} --- Read a single character in stream mode from stdin
+@findex @code{FGET} intrinsic
+@cindex file operations
+@cindex stream operations
@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 FGET
-@section @code{FGET} --- Read a single character from stdin in stream mode
-@findex @code{FGET} intrinsic
-@cindex undocumented intrinsic
-
-Intrinsic implemented, documentation pending.
+@node FGETC
+@section @code{FGETC} --- Read a single character in stream mode
+@findex @code{FGETC} intrinsic
+@cindex file operations
+@cindex stream operations
@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.
+
+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 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
@table @asis
@item @emph{Description}:
-@code{FNUM(UNIT)} returns the Posix file descriptor number corresponding to the
+@code{FNUM(UNIT)} returns the POSIX file descriptor number corresponding to the
open Fortran I/O unit @code{UNIT}.
@item @emph{Standard}:
@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
-
-Intrinsic implemented, documentation pending.
+@cindex file operations
+@cindex stream operations
@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
@node FPUTC
@section @code{FPUTC} --- Write a single character in stream mode
@findex @code{FPUTC} intrinsic
-@cindex undocumented intrinsic
-
-Intrinsic implemented, documentation pending.
+@cindex file operations
+@cindex stream operations
@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
@node GETCWD
@section @code{GETCWD} --- Get current working directory
@findex @code{GETCWD} intrinsic
-@cindex undocumented intrinsic
-
-Intrinsic implemented, documentation pending.
+@cindex file system functions
@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
-@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
@node NULL
-@section @code{NULL} --- Function that returns an dissassociated pointer
+@section @code{NULL} --- Function that returns an disassociated pointer
@findex @code{NULL} intrinsic
@cindex undocumented intrinsic
@node OR
-@section @code{OR} --- Logical inclusive disjunction
+@section @code{OR} --- Bitwise logical OR
@findex @code{OR} intrinsic
-@cindex logical operations
-
-Intrinsic implemented, documentation pending.
+@cindex bit operations
@table @asis
@item @emph{Description}:
+Bitwise logical @code{OR}.
+
+This intrinsic routine is provided for backwards compatibility with
+GNU Fortran 77. For integer arguments, programmers should consider
+the use of the @ref{IOR} intrinsic defined by the Fortran 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 is either @code{INTEGER(*)} or @code{LOGICAL}
+after cross-promotion of the arguments.
+
@item @emph{Example}:
+@smallexample
+PROGRAM test_or
+ LOGICAL :: T = .TRUE., F = ..FALSE.
+ INTEGER :: a, b
+ DATA a / Z'F' /, b / Z'3' /
+
+ 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
@end table
-
-
@node XOR
-@section @code{XOR} --- Logical exclusive or
+@section @code{XOR} --- Bitwise logical exclusive OR
@findex @code{XOR} intrinsic
-@cindex logical operations
-
-Intrinsic implemented, documentation pending.
+@cindex bit operations
@table @asis
@item @emph{Description}:
+Bitwise logical exclusive or.
+
+This intrinsic routine is provided for backwards compatibility with
+GNU Fortran 77. For integer arguments, programmers should consider
+the use of the @ref{IEOR} intrinsic defined by the Fortran 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 is either @code{INTEGER(*)} or @code{LOGICAL}
+after cross-promotion of the arguments.
+
@item @emph{Example}:
-@item @emph{Specific names}:
+@smallexample
+PROGRAM test_xor
+ LOGICAL :: T = .TRUE., F = .FALSE.
+ INTEGER :: a, b
+ DATA a / Z,'F' /, b / Z'3' /
+
+ 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