This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[fortran, patch, committed] Backport COMPLEX documentation to 4.2

As attached, including ChangeLog entry. Thanks again to Tobias Burnus for poking at me in the PR to make sure I didn't forget this!

Tested with "make doc/gfortran.pdf" and "make doc/" on i686-pc-linux-gnu.

- Brooks
Index: ChangeLog
--- ChangeLog	(revision 126536)
+++ ChangeLog	(working copy)
@@ -1,6 +1,13 @@
-2007-07-20  Daniel Franke  <>
+2007-07-10  Brooks Moses  <>
 	Backport from trunk:
+	PR fortran/31823
+	* intrinsic.texi (CMPLX): Document result kind.
+	(COMPLEX): Add documentation.
+2007-06-20  Daniel Franke  <>
+	Backport from trunk:
 	PR fortran/32002
 	* resolve.c (resolve_actual_arglist): Resolve actual argument after
 	being identified as variable.
Index: intrinsic.texi
--- intrinsic.texi	(revision 126536)
+++ intrinsic.texi	(working copy)
@@ -76,6 +76,7 @@
 * @code{CHMOD}:         CHMOD,     Change access permissions of files
 * @code{CMPLX}:         CMPLX,     Complex conversion function
 * @code{COMMAND_ARGUMENT_COUNT}: COMMAND_ARGUMENT_COUNT, Get number of command line arguments
+* @code{COMPLEX}:       COMPLEX,   Complex conversion function
 * @code{CONJG}:         CONJG,     Complex conjugate function
 * @code{COS}:           COS,       Cosine function
 * @code{COSH}:          COSH,      Hyperbolic cosine function
@@ -2083,7 +2084,10 @@
 @end multitable
 @item @emph{Return value}:
-The return value is of type @code{COMPLEX(*)}
+The return value is of @code{COMPLEX} type, with a kind equal to
+@var{KIND} if it is specified.  If @var{KIND} is not specified, the
+result is of the default @code{COMPLEX} kind, regardless of the kinds of
+@var{X} and @var{Y}. 
 @item @emph{Example}:
@@ -2095,6 +2099,9 @@
     print *, z, cmplx(x)
 end program test_cmplx
 @end smallexample
+@item @emph{See also}:
 @end table
@@ -2143,6 +2150,57 @@
+@node COMPLEX
+@section @code{COMPLEX} --- Complex conversion function
+@fnindex COMPLEX
+@cindex complex numbers, conversion to
+@cindex conversion, to complex
+@table @asis
+@item @emph{Description}:
+@code{COMPLEX(X, Y)} returns a complex number where @var{X} is converted
+to the real component and @var{Y} is converted to the imaginary
+@item @emph{Standard}:
+GNU extension
+@item @emph{Class}:
+Elemental function
+@item @emph{Syntax}:
+@code{RESULT = COMPLEX(X, Y)}
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .70
+@item @var{X} @tab The type may be @code{INTEGER(*)} or @code{REAL(*)}.
+@item @var{Y} @tab The type may be @code{INTEGER(*)} or @code{REAL(*)}.
+@end multitable
+@item @emph{Return value}:
+If @var{X} and @var{Y} are both of @code{INTEGER} type, then the return
+value is of default @code{COMPLEX} type.
+If @var{X} and @var{Y} are of @code{REAL} type, or one is of @code{REAL}
+type and one is of @code{INTEGER} type, then the return value is of
+@code{COMPLEX} type with a kind equal to that of the @code{REAL}
+argument with the highest precision.  
+@item @emph{Example}:
+program test_complex
+    integer :: i = 42
+    real :: x = 3.14
+    print *, complex(i, x)
+end program test_complex
+@end smallexample
+@item @emph{See also}:
+@end table
 @node CONJG
 @section @code{CONJG} --- Complex conjugate function 
 @fnindex CONJG

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]