OSDN Git Service

* Makefile.in (cs-tconfig.h): Pass USED_FOR_TARGET to mkconfig.sh
[pf3gnuchains/gcc-fork.git] / gcc / fortran / intrinsic.texi
1 @ignore
2 Copyright (C) 2005
3 Free Software Foundation, Inc.
4 This is part of the GFORTRAN manual.   
5 For copying conditions, see the file gfortran.texi.
6
7 Permission is granted to copy, distribute and/or modify this document
8 under the terms of the GNU Free Documentation License, Version 1.2 or
9 any later version published by the Free Software Foundation; with the
10 Invariant Sections being ``GNU General Public License'' and ``Funding
11 Free Software'', the Front-Cover texts being (a) (see below), and with
12 the Back-Cover Texts being (b) (see below).  A copy of the license is
13 included in the gfdl(7) man page.
14
15
16 Some basic guidelines for editing this document:
17
18   (1) The intrinsic procedures are to be listed in alphabetical order.
19   (2) The generic name is to be use.
20   (3) The specific names are included in the function index and in a
21       table at the end of the node (See ABS entry).
22   (4) Try to maintain the same style for each entry.
23
24
25 @end ignore
26
27 @node Intrinsic Procedures
28 @chapter Intrinsic Procedures
29 @cindex Intrinsic Procedures
30
31 This portion of the document is incomplete and undergoing massive expansion 
32 and editing.  All contributions and corrections are strongly encouraged. 
33
34 @menu
35 * Introduction:     Introduction
36 * @code{ABORT}:     ABORT,     Abort the program     
37 * @code{ABS}:       ABS,       Absolute value     
38 * @code{ACHAR}:     ACHAR,     Character in @acronym{ASCII} collating sequence
39 * @code{ACOS}:      ACOS,      Arccosine function
40 * @code{ADJUSTL}:   ADJUSTL,   Left adjust a string
41 * @code{ADJUSTR}:   ADJUSTR,   Right adjust a string
42 * @code{AIMAG}:     AIMAG,     Imaginary part of complex number
43 * @code{AINT}:      AINT,      Truncate to a whole number
44 * @code{ALL}:       ALL,       Determine if all values are true
45 * @code{ALLOCATED}: ALLOCATED, Status of allocatable entity
46 * @code{ANINT}:     ANINT,     Nearest whole number
47 * @code{ANY}:       ANY,       Determine if any values are true
48 * @code{ASIN}:      ASIN,      Arcsine function
49 * @code{ASSOCIATED}: ASSOCIATED, Status of a pointer or pointer/target pair
50 * @code{ATAN}:       ATAN,      Arctangent function
51 * @code{ATAN2}:      ATAN2,      Arctangent function
52 * @code{BESJ0}:     BESJ0,     Bessel function of the first kind of order 0
53 * @code{BESJ1}:     BESJ1,     Bessel function of the first kind of order 1
54 * @code{BESJN}:     BESJN,     Bessel function of the first kind
55 * @code{BESY0}:     BESY0,     Bessel function of the second kind of order 0
56 * @code{BESY1}:     BESY1,     Bessel function of the second kind of order 1
57 * @code{BESYN}:     BESYN,     Bessel function of the second kind
58 * @code{COS}:       COS,       Cosine function
59 * @code{COSH}:      COSH,      Hyperbolic cosine function
60 * @code{ERF}:       ERF,       Error function
61 * @code{ERFC}:      ERFC,      Complementary error function
62 * @code{EXP}:       EXP,       Cosine function
63 * @code{LOG}:       LOG,       Logarithm function
64 * @code{LOG10}:     LOG10,     Base 10 logarithm function 
65 * @code{SQRT}:      SQRT,      Square-root function
66 * @code{SIN}:       SIN,       Sine function
67 * @code{SINH}:      SINH,      Hyperbolic sine function
68 * @code{TAN}:       TAN,       Tangent function
69 * @code{TANH}:      TANH,      Hyperbolic tangent function
70 @end menu
71
72 @node Introduction
73 @section Introduction to intrinsic procedures
74
75 Gfortran provides a rich set of intrinsic procedures that includes all
76 the intrinsic procedures required by the Fortran 95 standard, a set of
77 intrinsic procedures for backwards compatibility with Gnu Fortran 77
78 (i.e., @command{g77}), and a small selection of intrinsic procedures
79 from the Fortran 2003 standard.  Any description here, which conflicts with a 
80 description in either the Fortran 95 standard or the Fortran 2003 standard,
81 is unintentional and the standard(s) should be considered authoritative.
82
83 The enumeration of the @code{KIND} type parameter is processor defined in
84 the Fortran 95 standard.  Gfortran defines the default integer type and
85 default real type by @code{INTEGER(KIND=4)} and @code{REAL(KIND=4)},
86 respectively.  The standard mandates that both data types shall have
87 another kind, which have more precision.  On typical target architectures
88 supports by @command{gfortran}, this kind type parameter is @code{KIND=8}.
89 Hence, @code{REAL(KIND=8)} and @code{DOUBLE PRECISION} are equivalent.
90 In the description of generic intrinsic procedures, the kind type parameter
91 will be specified by @code{KIND=*}, and in the description of specific
92 names for an intrinsic procedure the kind type parameter will be explicitly
93 given (e.g., @code{REAL(KIND=4)} or @code{REAL(KIND=8)}).  Finally, for
94 brevity the optional @code{KIND=} syntax will be omitted.
95
96 Many of the intrinsics procedures take one or more optional arguments.
97 This document follows the convention used in the Fortran 95 standard,
98 and denotes such arguments by square brackets.
99
100 @command{Gfortran} offers the @option{-std=f95} and @option{-std=gnu} options,
101 which can be used to restrict the set of intrinsic procedures to a 
102 given standard.  By default, @command{gfortran} sets the @option{-std=gnu}
103 option, and so all intrinsic procedures describe here are accepted.  There
104 is one caveat.  For a select group of intrinsic procedures, @command{g77}
105 implemented both a function and a subroutine.  Both classes 
106 have been implemented in @command{gfortran} for backwards compatibility
107 with @command{g77}.  It is noted here that these functions and subroutines
108 cannot be intermixed in a given subprogram.  In the descriptions that follow,
109 the applicable option(s) is noted.
110
111
112
113 @node ABORT
114 @section @code{ABORT} --- Abort the program  
115 @findex @code{ABORT}
116 @cindex abort
117
118 @table @asis
119 @item @emph{Description}:
120 @code{ABORT} causes immediate termination of the program.  On operating
121 systems that support a core dump, @code{ABORT} will produce a core dump,
122 which is suitable for debugging purposes.
123
124 @item @emph{Option}:
125 gnu
126
127 @item @emph{Type}:
128 non-elemental subroutine
129
130 @item @emph{Syntax}:
131 @code{CALL ABORT}
132
133 @item @emph{Return value}:
134 Does not return.
135
136 @item @emph{Example}:
137 @smallexample
138 program test_abort
139   integer :: i = 1, j = 2
140   if (i /= j) call abort
141 end program test_abort
142 @end smallexample
143 @end table
144
145
146
147 @node ABS
148 @section @code{ABS} --- Absolute value  
149 @findex @code{ABS} intrinsic
150 @findex @code{CABS} intrinsic
151 @findex @code{DABS} intrinsic
152 @findex @code{IABS} intrinsic
153 @findex @code{ZABS} intrinsic
154 @findex @code{CDABS} intrinsic
155 @cindex absolute value
156
157 @table @asis
158 @item @emph{Description}:
159 @code{ABS(X)} computes the absolute value of @code{X}.
160
161 @item @emph{Option}:
162 f95, gnu
163
164 @item @emph{Type}:
165 elemental function
166
167 @item @emph{Syntax}:
168 @code{X = ABS(X)}
169
170 @item @emph{Arguments}:
171 @multitable @columnfractions .15 .80
172 @item @var{X} @tab The type of the argument shall be an @code{INTEGER(*)},
173 @code{REAL(*)}, or @code{COMPLEX(*)}.
174 @end multitable
175
176 @item @emph{Return value}:
177 The return value is of the same type and
178 kind as the argument except the return value is @code{REAL(*)} for a
179 @code{COMPLEX(*)} argument.
180
181 @item @emph{Example}:
182 @smallexample
183 program test_abs
184   integer :: i = -1
185   real :: x = -1.e0
186   complex :: z = (-1.e0,0.e0)
187   i = abs(i)
188   x = abs(x)
189   x = abs(z)
190 end program test_abs
191 @end smallexample
192
193 @item @emph{Specific names}:
194 @multitable @columnfractions .24 .24 .24 .24
195 @item Name            @tab Argument            @tab Return type       @tab Option
196 @item @code{CABS(Z)}  @tab @code{COMPLEX(4) Z} @tab @code{REAL(4)}    @tab f95, gnu
197 @item @code{DABS(X)}  @tab @code{REAL(8)    X} @tab @code{REAL(8)}    @tab f95, gnu
198 @item @code{IABS(I)}  @tab @code{INTEGER(4) I} @tab @code{INTEGER(4)} @tab f95, gnu
199 @item @code{ZABS(Z)}  @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab gnu
200 @item @code{CDABS(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab gnu
201 @end multitable
202 @end table
203
204
205
206 @node ACHAR
207 @section @code{ACHAR} --- Character in @acronym{ASCII} collating sequence 
208 @findex @code{ACHAR} intrinsic
209 @cindex @acronym{ASCII} collating sequence
210
211 @table @asis
212 @item @emph{Description}:
213 @code{ACHAR(I)} returns the character located at position @code{I}
214 in the @acronym{ASCII} collating sequence.
215
216 @item @emph{Option}:
217 f95, gnu
218
219 @item @emph{Type}:
220 elemental function
221
222 @item @emph{Syntax}:
223 @code{C = ACHAR(I)}
224
225 @item @emph{Arguments}:
226 @multitable @columnfractions .15 .80
227 @item @var{I} @tab The type shall be an @code{INTEGER(*)}.
228 @end multitable
229
230 @item @emph{Return value}:
231 The return value is of type @code{CHARACTER} with a length of one.  The
232 kind type parameter is the same as  @code{KIND('A')}.
233
234 @item @emph{Example}:
235 @smallexample
236 program test_achar
237   character c
238   c = achar(32)
239 end program test_achar
240 @end smallexample
241 @end table
242
243
244
245 @node ACOS
246 @section @code{ACOS} --- Arccosine function 
247 @findex @code{ACOS} intrinsic
248 @findex @code{DACOS} intrinsic
249 @cindex arccosine
250
251 @table @asis
252 @item @emph{Description}:
253 @code{ACOS(X)} computes the arccosine of its @var{X}.
254
255 @item @emph{Option}:
256 f95, gnu
257
258 @item @emph{Type}:
259 elemental function
260
261 @item @emph{Syntax}:
262 @code{X = ACOS(X)}
263
264 @item @emph{Arguments}:
265 @multitable @columnfractions .15 .80
266 @item @var{X} @tab The type shall be an @code{REAL(*)}, and a magnitude that is
267 less than one.
268 @end multitable
269
270 @item @emph{Return value}:
271 The return value is of type @code{REAL(*)} and it lies in the
272 range @math{ 0 \leq \arccos (x) \leq \pi}.  The kind type
273 parameter is the same as @var{X}.
274
275 @item @emph{Example}:
276 @smallexample
277 program test_acos
278   real(8) :: x = 0.866_8
279   x = achar(x)
280 end program test_acos
281 @end smallexample
282
283 @item @emph{Specific names}:
284 @multitable @columnfractions .24 .24 .24 .24
285 @item Name            @tab Argument          @tab Return type       @tab Option
286 @item @code{DACOS(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
287 @end multitable
288 @end table
289
290
291
292 @node ADJUSTL
293 @section @code{ADJUSTL} --- Left adjust a string 
294 @findex @code{ADJUSTL} intrinsic
295 @cindex adjust string
296
297 @table @asis
298 @item @emph{Description}:
299 @code{ADJUSTL(STR)} will left adjust a string by removing leading spaces.
300 Spaces are inserted at the end of the string as needed.
301
302 @item @emph{Option}:
303 f95, gnu
304
305 @item @emph{Type}:
306 elemental function
307
308 @item @emph{Syntax}:
309 @code{STR = ADJUSTL(STR)}
310
311 @item @emph{Arguments}:
312 @multitable @columnfractions .15 .80
313 @item @var{STR} @tab The type shall be @code{CHARACTER}.
314 @end multitable
315
316 @item @emph{Return value}:
317 The return value is of type @code{CHARACTER} where leading spaces 
318 are removed and the same number of spaces are inserted on the end
319 of @var{STR}.
320
321 @item @emph{Example}:
322 @smallexample
323 program test_adjustl
324   character(len=20) :: str = '   gfortran'
325   str = adjustl(str)
326   print *, str
327 end program test_adjustl
328 @end smallexample
329 @end table
330
331
332 @node ADJUSTR
333 @section @code{ADJUSTR} --- Right adjust a string 
334 @findex @code{ADJUSTR} intrinsic
335 @cindex adjust string
336
337 @table @asis
338 @item @emph{Description}:
339 @code{ADJUSTR(STR)} will right adjust a string by removing trailing spaces.
340 Spaces are inserted at the start of the string as needed.
341
342 @item @emph{Option}:
343 f95, gnu
344
345 @item @emph{Type}:
346 elemental function
347
348 @item @emph{Syntax}:
349 @code{STR = ADJUSTR(STR)}
350
351 @item @emph{Arguments}:
352 @multitable @columnfractions .15 .80
353 @item @var{STR} @tab The type shall be @code{CHARACTER}.
354 @end multitable
355
356 @item @emph{Return value}:
357 The return value is of type @code{CHARACTER} where trailing spaces 
358 are removed and the same number of spaces are inserted at the start
359 of @var{STR}.
360
361 @item @emph{Example}:
362 @smallexample
363 program test_adjustr
364   character(len=20) :: str = 'gfortran'
365   str = adjustr(str)
366   print *, str
367 end program test_adjustr
368 @end smallexample
369 @end table
370
371
372 @node AIMAG
373 @section @code{AIMAG} --- Imaginary part of complex number  
374 @findex @code{AIMAG} intrinsic
375 @findex @code{DIMAG} intrinsic
376 @cindex Imaginary part
377
378 @table @asis
379 @item @emph{Description}:
380 @code{AIMAG(Z)} yields the imaginary part of complex argument @code{Z}.
381
382 @item @emph{Option}:
383 f95, gnu
384
385 @item @emph{Type}:
386 elemental function
387
388 @item @emph{Syntax}:
389 @code{X = AIMAG(Z)}
390
391 @item @emph{Arguments}:
392 @multitable @columnfractions .15 .80
393 @item @var{Z} @tab The type of the argument shall be @code{COMPLEX(*)}.
394 @end multitable
395
396 @item @emph{Return value}:
397 The return value is of type real with the
398 kind type parameter of the argument.
399
400 @item @emph{Example}:
401 @smallexample
402 program test_aimag
403   complex(4) z4
404   complex(8) z8
405   z4 = cmplx(1.e0_4, 0.e0_4)
406   z8 = cmplx(0.e0_8, 1.e0_8)
407   print *, aimag(z4), dimag(z8)
408 end program test_aimag
409 @end smallexample
410
411 @item @emph{Specific names}:
412 @multitable @columnfractions .24 .24 .24 .24
413 @item Name            @tab Argument            @tab Return type       @tab Option
414 @item @code{DIMAG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{REAL(8)}    @tab f95, gnu
415 @end multitable
416 @end table
417
418
419 @node AINT
420 @section @code{AINT} --- Imaginary part of complex number  
421 @findex @code{AINT} intrinsic
422 @findex @code{DINT} intrinsic
423 @cindex whole number
424
425 @table @asis
426 @item @emph{Description}:
427 @code{AINT(X [, KIND])} truncates its argument to a whole number.
428
429 @item @emph{Option}:
430 f95, gnu
431
432 @item @emph{Type}:
433 elemental function
434
435 @item @emph{Syntax}:
436 @code{X = AINT(X)} @*
437 @code{X = AINT(X, KIND)}
438
439 @item @emph{Arguments}:
440 @multitable @columnfractions .15 .80
441 @item @var{X}    @tab The type of the argument shall be @code{REAL(*)}.
442 @item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer
443 initialization expression.
444 @end multitable
445
446 @item @emph{Return value}:
447 The return value is of type real with the kind type parameter of the
448 argument if the optional @var{KIND} is absence; otherwise, the kind
449 type parameter will be given by @var{KIND}.  If the magnitude of 
450 @var{X} is less than one, then @code{AINT(X)} returns zero.  If the
451 magnitude is equal to or greater than one, then it returns the largest
452 whole number that does not exceed its magnitude.  The sign is the same
453 as the sign of @var{X}. 
454
455 @item @emph{Example}:
456 @smallexample
457 program test_aint
458   real(4) x4
459   real(8) x8
460   x4 = 1.234E0_4
461   x8 = 4.321_8
462   print *, aint(x4), dint(x8)
463   x8 = aint(x4,8)
464 end program test_aint
465 @end smallexample
466
467 @item @emph{Specific names}:
468 @multitable @columnfractions .24 .24 .24 .24
469 @item Name           @tab Argument         @tab Return type      @tab Option
470 @item @code{DINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)}   @tab f95, gnu
471 @end multitable
472 @end table
473
474
475 @node ALL
476 @section @code{ALL} --- All values in @var{MASK} along @var{DIM} are true 
477 @findex @code{ALL} intrinsic
478 @cindex true values
479
480 @table @asis
481 @item @emph{Description}:
482 @code{ALL(MASK [, DIM])} determines if all the values are true in @var{MASK}
483 in the array along dimension @var{DIM}.
484
485 @item @emph{Option}:
486 f95, gnu
487
488 @item @emph{Type}:
489 transformational function
490
491 @item @emph{Syntax}:
492 @code{L = ALL(MASK)} @*
493 @code{L = ALL(MASK, DIM)}
494
495 @item @emph{Arguments}:
496 @multitable @columnfractions .15 .80
497 @item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and
498 it shall not be scalar.
499 @item @var{DIM}  @tab (Optional) @var{DIM} shall be a scalar integer
500 with a value that lies between one and the rank of @var{MASK}.
501 @end multitable
502
503 @item @emph{Return value}:
504 @code{ALL(MASK)} returns a scalar value of type @code{LOGICAL(*)} where
505 the kind type parameter is the same as the kind type parameter of
506 @var{MASK}.  If @var{DIM} is present, then @code{ALL(MASK, DIM)} returns
507 an array with the rank of @var{MASK} minus 1.  The shape is determined from
508 the shape of @var{MASK} where the @var{DIM} dimension is elided. 
509
510 @table @asis
511 @item (A)
512 @code{ALL(MASK)} is true if all elements of @var{MASK} are true.
513 It also is true if @var{MASK} has zero size; otherwise, it is false.
514 @item (B)
515 If the rank of @var{MASK} is one, then @code{ALL(MASK,DIM)} is equivalent
516 to @code{ALL(MASK)}.  If the rank is greater than one, then @code{ALL(MASK,DIM)}
517 is determined by applying @code{ALL} to the array sections.
518 @end table
519
520 @item @emph{Example}:
521 @smallexample
522 program test_all
523   logical l
524   l = all((/.true., .true., .true./))
525   print *, l
526   call section
527   contains
528     subroutine section
529       integer a(2,3), b(2,3)
530       a = 1
531       b = 1
532       b(2,2) = 2
533       print *, all(a .eq. b, 1)
534       print *, all(a .eq. b, 2)
535     end subroutine section
536 end program test_all
537 @end smallexample
538 @end table
539
540
541
542 @node ALLOCATED
543 @section @code{ALLOCATED} --- Status of an allocatable entity
544 @findex @code{ALLOCATED} intrinsic
545 @cindex allocation status
546
547 @table @asis
548 @item @emph{Description}:
549 @code{ALLOCATED(X)} checks the status of wether @var{X} is allocated.
550
551 @item @emph{Option}:
552 f95, gnu
553
554 @item @emph{Type}:
555 inquiry function
556
557 @item @emph{Syntax}:
558 @code{L = ALLOCATED(X)}
559
560 @item @emph{Arguments}:
561 @multitable @columnfractions .15 .80
562 @item @var{X}    @tab The argument shall be an @code{ALLOCATABLE} array.
563 @end multitable
564
565 @item @emph{Return value}:
566 The return value is a scalar @code{LOGICAL} with the default logical
567 kind type parameter.  If @var{X} is allocated, @code{ALLOCATED(X)}
568 is @code{.TRUE.}; otherwise, it returns the @code{.TRUE.} 
569
570 @item @emph{Example}:
571 @smallexample
572 program test_allocated
573   integer :: i = 4
574   real(4), allocatable :: x(:)
575   if (allocated(x) .eqv. .false.) allocate(x(i)
576 end program test_allocated
577 @end smallexample
578 @end table
579
580
581 @node ANINT
582 @section @code{ANINT} --- Imaginary part of complex number  
583 @findex @code{ANINT} intrinsic
584 @findex @code{DNINT} intrinsic
585 @cindex whole number
586
587 @table @asis
588 @item @emph{Description}:
589 @code{ANINT(X [, KIND])} rounds its argument to the nearest whole number.
590
591 @item @emph{Option}:
592 f95, gnu
593
594 @item @emph{Type}:
595 elemental function
596
597 @item @emph{Syntax}:
598 @code{X = ANINT(X)} @*
599 @code{X = ANINT(X, KIND)}
600
601 @item @emph{Arguments}:
602 @multitable @columnfractions .15 .80
603 @item @var{X}    @tab The type of the argument shall be @code{REAL(*)}.
604 @item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer
605 initialization expression.
606 @end multitable
607
608 @item @emph{Return value}:
609 The return value is of type real with the kind type parameter of the
610 argument if the optional @var{KIND} is absence; otherwise, the kind
611 type parameter will be given by @var{KIND}.  If @var{X} is greater than
612 zero, then @code{ANINT(X)} returns @code{AINT(X+0.5)}.  If @var{X} is
613 less than or equal to zero, then return @code{AINT(X-0.5)}.
614
615 @item @emph{Example}:
616 @smallexample
617 program test_anint
618   real(4) x4
619   real(8) x8
620   x4 = 1.234E0_4
621   x8 = 4.321_8
622   print *, anint(x4), dnint(x8)
623   x8 = anint(x4,8)
624 end program test_anint
625 @end smallexample
626
627 @item @emph{Specific names}:
628 @multitable @columnfractions .24 .24 .24 .24
629 @item Name            @tab Argument         @tab Return type      @tab Option
630 @item @code{DNINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)}   @tab f95, gnu
631 @end multitable
632 @end table
633
634
635 @node ANY
636 @section @code{ANY} --- Any value in @var{MASK} along @var{DIM} is true 
637 @findex @code{ANY} intrinsic
638 @cindex true values
639
640 @table @asis
641 @item @emph{Description}:
642 @code{ANY(MASK [, DIM])} determines if any of the values is true in @var{MASK}
643 in the array along dimension @var{DIM}.
644
645 @item @emph{Option}:
646 f95, gnu
647
648 @item @emph{Type}:
649 transformational function
650
651 @item @emph{Syntax}:
652 @code{L = ANY(MASK)} @*
653 @code{L = ANY(MASK, DIM)}
654
655 @item @emph{Arguments}:
656 @multitable @columnfractions .15 .80
657 @item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and
658 it shall not be scalar.
659 @item @var{DIM}  @tab (Optional) @var{DIM} shall be a scalar integer
660 with a value that lies between one and the rank of @var{MASK}.
661 @end multitable
662
663 @item @emph{Return value}:
664 @code{ANY(MASK)} returns a scalar value of type @code{LOGICAL(*)} where
665 the kind type parameter is the same as the kind type parameter of
666 @var{MASK}.  If @var{DIM} is present, then @code{ANY(MASK, DIM)} returns
667 an array with the rank of @var{MASK} minus 1.  The shape is determined from
668 the shape of @var{MASK} where the @var{DIM} dimension is elided. 
669
670 @table @asis
671 @item (A)
672 @code{ANY(MASK)} is true if any element of @var{MASK} is true;
673 otherwise, it is false.  It also is false if @var{MASK} has zero size.
674 @item (B)
675 If the rank of @var{MASK} is one, then @code{ANY(MASK,DIM)} is equivalent
676 to @code{ANY(MASK)}.  If the rank is greater than one, then @code{ANY(MASK,DIM)}
677 is determined by applying @code{ANY} to the array sections.
678 @end table
679
680 @item @emph{Example}:
681 @smallexample
682 program test_any
683   logical l
684   l = any((/.true., .true., .true./))
685   print *, l
686   call section
687   contains
688     subroutine section
689       integer a(2,3), b(2,3)
690       a = 1
691       b = 1
692       b(2,2) = 2
693       print *, any(a .eq. b, 1)
694       print *, any(a .eq. b, 2)
695     end subroutine section
696 end program test_any
697 @end smallexample
698 @end table
699
700
701 @node ASIN
702 @section @code{ASIN} --- Arcsine function 
703 @findex @code{ASIN} intrinsic
704 @findex @code{DASIN} intrinsic
705 @cindex arcsine
706
707 @table @asis
708 @item @emph{Description}:
709 @code{ASIN(X)} computes the arcsine of its @var{X}.
710
711 @item @emph{Option}:
712 f95, gnu
713
714 @item @emph{Type}:
715 elemental function
716
717 @item @emph{Syntax}:
718 @code{X = ASIN(X)}
719
720 @item @emph{Arguments}:
721 @multitable @columnfractions .15 .80
722 @item @var{X} @tab The type shall be an @code{REAL(*)}, and a magnitude that is
723 less than one.
724 @end multitable
725
726 @item @emph{Return value}:
727 The return value is of type @code{REAL(*)} and it lies in the
728 range @math{-\pi / 2 \leq \arccos (x) \leq \pi / 2}.  The kind type
729 parameter is the same as @var{X}.
730
731 @item @emph{Example}:
732 @smallexample
733 program test_asin
734   real(8) :: x = 0.866_8
735   x = asin(x)
736 end program test_asin
737 @end smallexample
738
739 @item @emph{Specific names}:
740 @multitable @columnfractions .24 .24 .24 .24
741 @item Name            @tab Argument          @tab Return type       @tab Option
742 @item @code{DASIN(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
743 @end multitable
744 @end table
745
746
747 @node ASSOCIATED
748 @section @code{ASSOCIATED} --- Status of a pointer or pointer/target pair 
749 @findex @code{ASSOCIATED} intrinsic
750 @cindex pointer status
751
752 @table @asis
753 @item @emph{Description}:
754 @code{ASSOCIATED(PTR [, TGT])} determines the status of the pointer @var{PTR}
755 or if @var{PTR} is associated with the target @var{TGT}.
756
757 @item @emph{Option}:
758 f95, gnu
759
760 @item @emph{Type}:
761 inquiry function
762
763 @item @emph{Syntax}:
764 @code{L = ASSOCIATED(PTR)} @*
765 @code{L = ASSOCIATED(PTR [, TGT])}
766
767 @item @emph{Arguments}:
768 @multitable @columnfractions .15 .80
769 @item @var{PTR} @tab @var{PTR} shall have the @code{POINTER} attribute and
770 it can be of any type.
771 @item @var{TGT} @tab (Optional) @var{TGT} shall be a @code{POINTER} or
772 a @code{TARGET}.  It must have the same type, kind type parameter, and
773 array rank as @var{PTR}.
774 @end multitable
775 The status of neither @var{PTR} nor @var{TGT} can be undefined.
776
777 @item @emph{Return value}:
778 @code{ASSOCIATED(PTR)} returns a scalar value of type @code{LOGICAL(4)}.
779 There are several cases:
780 @table @asis
781 @item (A) If the optional @var{TGT} is not present, then @code{ASSOCIATED(PTR)}
782 is true if @var{PTR} is associated with a target; otherwise, it returns false.
783 @item (B) If @var{TGT} is present and a scalar target, the result is true if
784 @var{TGT}
785 is not a 0 sized storage sequence and the target associated with @var{PTR}
786 occupies the same storage units.  If @var{PTR} is disassociated, then the 
787 result is false.
788 @item (C) If @var{TGT} is present and an array target, the result is true if
789 @var{TGT} and @var{PTR} have the same shape, are not 0 sized arrays, are
790 arrays whose elements are not 0 sized storage sequences, and @var{TGT} and
791 @var{PTR} occupy the same storage units in array element order.
792 As in case(B), the result is false, if @var{PTR} is disassociated.
793 @item (D) If @var{TGT} is present and an scalar pointer, the result is true if
794 target associated with @var{PTR} and the target associated with @var{TGT}
795 are not 0 sized storage sequences and occupy the same storage units.
796 The result is false, if either @var{TGT} or @var{PTR} is disassociated.
797 @item (E) If @var{TGT} is present and an array pointer, the result is true if
798 target assoicated with @var{PTR} and the target associated with @var{TGT}
799 have the same shape, are not 0 sized arrays, are arrays whose elements are
800 not 0 sized storage sequences, and @var{TGT} and @var{PTR} occupy the same
801 storage units in array element order.
802 The result is false, if either @var{TGT} or @var{PTR} is disassociated.
803 @end table
804
805 @item @emph{Example}:
806 @smallexample
807 program test_associated
808    implicit none
809    real, target  :: tgt(2) = (/1., 2./)
810    real, pointer :: ptr(:)
811    ptr => tgt
812    if (associated(ptr)     .eqv. .false.) call abort
813    if (associated(ptr,tgt) .eqv. .false.) call abort
814 end program test_associated
815 @end smallexample
816 @end table
817
818
819 @node ATAN
820 @section @code{ATAN} --- Arctangent function 
821 @findex @code{ATAN} intrinsic
822 @findex @code{DATAN} intrinsic
823 @cindex arctangent
824
825 @table @asis
826 @item @emph{Description}:
827 @code{ATAN(X)} computes the arctangent of @var{X}.
828
829 @item @emph{Option}:
830 f95, gnu
831
832 @item @emph{Type}:
833 elemental function
834
835 @item @emph{Syntax}:
836 @code{X = ATAN(X)}
837
838 @item @emph{Arguments}:
839 @multitable @columnfractions .15 .80
840 @item @var{X} @tab The type shall be an @code{REAL(*)}.
841 @end multitable
842
843 @item @emph{Return value}:
844 The return value is of type @code{REAL(*)} and it lies in the
845 range @math{ - \pi / 2 \leq \arcsin (x) \leq \pi / 2}.
846
847 @item @emph{Example}:
848 @smallexample
849 program test_atan
850   real(8) :: x = 2.866_8
851   x = atan(x)
852 end program test_atan
853 @end smallexample
854
855 @item @emph{Specific names}:
856 @multitable @columnfractions .24 .24 .24 .24
857 @item Name            @tab Argument          @tab Return type       @tab Option
858 @item @code{DATAN(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
859 @end multitable
860 @end table
861
862
863 @node ATAN2
864 @section @code{ATAN2} --- Arctangent function 
865 @findex @code{ATAN2} intrinsic
866 @findex @code{DATAN2} intrinsic
867 @cindex arctangent
868
869 @table @asis
870 @item @emph{Description}:
871 @code{ATAN2(Y,X)} computes the arctangent of the complex number @math{X + i Y}.
872
873 @item @emph{Option}:
874 f95, gnu
875
876 @item @emph{Type}:
877 elemental function
878
879 @item @emph{Syntax}:
880 @code{X = ATAN2(Y,X)}
881
882 @item @emph{Arguments}:
883 @multitable @columnfractions .15 .80
884 @item @var{Y} @tab The type shall be @code{REAL(*)}.
885 @item @var{X} @tab The type and kind type paremeter shall be the same as @var{Y}.
886 If @var{Y} is zero, then @var{X} must be nonzero.
887 @end multitable
888
889 @item @emph{Return value}:
890 The return value has the same type and kind type paremeter as @var{Y}.
891 It is the principle value of the complex number @math{X + i Y}.  If
892 @var{X} is nonzero, then it lies in the range @math{-\pi \le \arccos (x) \leq \pi}.
893 The sign is positive if @var{Y} is positive.  If @var{Y} is zero, then
894 the return value is zero if @var{X} is positive and @math{\pi} if @var{X}
895 is negative.  Finally, if @var{X} is zero, then the magnitude of the result
896 is @math{\pi/2}.
897
898 @item @emph{Example}:
899 @smallexample
900 program test_atan2
901   real(4) :: x = 1.e0_4, y = 0.5e0_4
902   x = atan2(y,x)
903 end program test_atan2
904 @end smallexample
905
906 @item @emph{Specific names}:
907 @multitable @columnfractions .24 .24 .24 .24
908 @item Name            @tab Argument          @tab Return type    @tab Option
909 @item @code{DATAN2(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
910 @end multitable
911 @end table
912
913
914 @node BESJ0
915 @section @code{BESJ0} --- Bessel function of the first kind of order 0
916 @findex @code{BESJ0} intrinsic
917 @findex @code{DBESJ0} intrinsic
918 @cindex Bessel
919
920 @table @asis
921 @item @emph{Description}:
922 @code{BESJ0(X)} computes the Bessel function of the first kind of order 0
923 of @var{X}.
924
925 @item @emph{Option}:
926 gnu
927
928 @item @emph{Type}:
929 elemental function
930
931 @item @emph{Syntax}:
932 @code{X = BESJ0(X)}
933
934 @item @emph{Arguments}:
935 @multitable @columnfractions .15 .80
936 @item @var{X} @tab The type shall be an @code{REAL(*)}, and it shall be scalar.
937 @end multitable
938
939 @item @emph{Return value}:
940 The return value is of type @code{REAL(*)} and it lies in the
941 range @math{ - 0.4027... \leq Bessel (0,x) \leq 1}.
942
943 @item @emph{Example}:
944 @smallexample
945 program test_besj0
946   real(8) :: x = 0.0_8
947   x = besj0(x)
948 end program test_besj0
949 @end smallexample
950
951 @item @emph{Specific names}:
952 @multitable @columnfractions .24 .24 .24 .24
953 @item Name            @tab Argument          @tab Return type       @tab Option
954 @item @code{DBESJ0(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab gnu
955 @end multitable
956 @end table
957
958
959
960 @node BESJ1
961 @section @code{BESJ1} --- Bessel function of the first kind of order 1
962 @findex @code{BESJ1} intrinsic
963 @findex @code{DBESJ1} intrinsic
964 @cindex Bessel
965
966 @table @asis
967 @item @emph{Description}:
968 @code{BESJ1(X)} computes the Bessel function of the first kind of order 1
969 of @var{X}.
970
971 @item @emph{Option}:
972 gnu
973
974 @item @emph{Type}:
975 elemental function
976
977 @item @emph{Syntax}:
978 @code{X = BESJ1(X)}
979
980 @item @emph{Arguments}:
981 @multitable @columnfractions .15 .80
982 @item @var{X} @tab The type shall be an @code{REAL(*)}, and it shall be scalar.
983 @end multitable
984
985 @item @emph{Return value}:
986 The return value is of type @code{REAL(*)} and it lies in the
987 range @math{ - 0.5818... \leq Bessel (0,x) \leq 0.5818 }.
988
989 @item @emph{Example}:
990 @smallexample
991 program test_besj1
992   real(8) :: x = 1.0_8
993   x = besj1(x)
994 end program test_besj1
995 @end smallexample
996
997 @item @emph{Specific names}:
998 @multitable @columnfractions .24 .24 .24 .24
999 @item Name            @tab Argument          @tab Return type       @tab Option
1000 @item @code{DBESJ1(X)}@tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab gnu
1001 @end multitable
1002 @end table
1003
1004
1005
1006 @node BESJN
1007 @section @code{BESJN} --- Bessel function of the first kind
1008 @findex @code{BESJN} intrinsic
1009 @findex @code{DBESJN} intrinsic
1010 @cindex Bessel
1011
1012 @table @asis
1013 @item @emph{Description}:
1014 @code{BESJN(N, X)} computes the Bessel function of the first kind of order
1015 @var{N} of @var{X}.
1016
1017 @item @emph{Option}:
1018 gnu
1019
1020 @item @emph{Type}:
1021 elemental function
1022
1023 @item @emph{Syntax}:
1024 @code{Y = BESJN(N, X)}
1025
1026 @item @emph{Arguments}:
1027 @multitable @columnfractions .15 .80
1028 @item @var{N} @tab The type shall be an @code{INTEGER(*)}, and it shall be scalar.
1029 @item @var{X} @tab The type shall be an @code{REAL(*)}, and it shall be scalar.
1030 @end multitable
1031
1032 @item @emph{Return value}:
1033 The return value is a scalar of type @code{REAL(*)}.
1034
1035 @item @emph{Example}:
1036 @smallexample
1037 program test_besjn
1038   real(8) :: x = 1.0_8
1039   x = besjn(5,x)
1040 end program test_besjn
1041 @end smallexample
1042
1043 @item @emph{Specific names}:
1044 @multitable @columnfractions .24 .24 .24 .24
1045 @item Name             @tab Argument            @tab Return type       @tab Option
1046 @item @code{DBESJN(X)} @tab @code{INTEGER(*) N} @tab @code{REAL(8)}    @tab gnu
1047 @item                  @tab @code{REAL(8) X}    @tab                   @tab
1048 @end multitable
1049 @end table
1050
1051
1052
1053 @node BESY0
1054 @section @code{BESY0} --- Bessel function of the second kind of order 0
1055 @findex @code{BESY0} intrinsic
1056 @findex @code{DBESY0} intrinsic
1057 @cindex Bessel
1058
1059 @table @asis
1060 @item @emph{Description}:
1061 @code{BESY0(X)} computes the Bessel function of the second kind of order 0
1062 of @var{X}.
1063
1064 @item @emph{Option}:
1065 gnu
1066
1067 @item @emph{Type}:
1068 elemental function
1069
1070 @item @emph{Syntax}:
1071 @code{X = BESY0(X)}
1072
1073 @item @emph{Arguments}:
1074 @multitable @columnfractions .15 .80
1075 @item @var{X} @tab The type shall be an @code{REAL(*)}, and it shall be scalar.
1076 @end multitable
1077
1078 @item @emph{Return value}:
1079 The return value is a scalar of type @code{REAL(*)}.
1080
1081 @item @emph{Example}:
1082 @smallexample
1083 program test_besy0
1084   real(8) :: x = 0.0_8
1085   x = besy0(x)
1086 end program test_besy0
1087 @end smallexample
1088
1089 @item @emph{Specific names}:
1090 @multitable @columnfractions .24 .24 .24 .24
1091 @item Name            @tab Argument          @tab Return type       @tab Option
1092 @item @code{DBESY0(X)}@tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab gnu
1093 @end multitable
1094 @end table
1095
1096
1097
1098 @node BESY1
1099 @section @code{BESY1} --- Bessel function of the second kind of order 1
1100 @findex @code{BESY1} intrinsic
1101 @findex @code{DBESY1} intrinsic
1102 @cindex Bessel
1103
1104 @table @asis
1105 @item @emph{Description}:
1106 @code{BESY1(X)} computes the Bessel function of the second kind of order 1
1107 of @var{X}.
1108
1109 @item @emph{Option}:
1110 gnu
1111
1112 @item @emph{Type}:
1113 elemental function
1114
1115 @item @emph{Syntax}:
1116 @code{X = BESY1(X)}
1117
1118 @item @emph{Arguments}:
1119 @multitable @columnfractions .15 .80
1120 @item @var{X} @tab The type shall be an @code{REAL(*)}, and it shall be scalar.
1121 @end multitable
1122
1123 @item @emph{Return value}:
1124 The return value is a scalar of type @code{REAL(*)}.
1125
1126 @item @emph{Example}:
1127 @smallexample
1128 program test_besy1
1129   real(8) :: x = 1.0_8
1130   x = besy1(x)
1131 end program test_besy1
1132 @end smallexample
1133
1134 @item @emph{Specific names}:
1135 @multitable @columnfractions .24 .24 .24 .24
1136 @item Name            @tab Argument          @tab Return type       @tab Option
1137 @item @code{DBESY1(X)}@tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab gnu
1138 @end multitable
1139 @end table
1140
1141
1142
1143 @node BESYN
1144 @section @code{BESYN} --- Bessel function of the second kind
1145 @findex @code{BESYN} intrinsic
1146 @findex @code{DBESYN} intrinsic
1147 @cindex Bessel
1148
1149 @table @asis
1150 @item @emph{Description}:
1151 @code{BESYN(N, X)} computes the Bessel function of the second kind of order
1152 @var{N} of @var{X}.
1153
1154 @item @emph{Option}:
1155 gnu
1156
1157 @item @emph{Type}:
1158 elemental function
1159
1160 @item @emph{Syntax}:
1161 @code{Y = BESYN(N, X)}
1162
1163 @item @emph{Arguments}:
1164 @multitable @columnfractions .15 .80
1165 @item @var{N} @tab The type shall be an @code{INTEGER(*)}, and it shall be scalar.
1166 @item @var{X} @tab The type shall be an @code{REAL(*)}, and it shall be scalar.
1167 @end multitable
1168
1169 @item @emph{Return value}:
1170 The return value is a scalar of type @code{REAL(*)}.
1171
1172 @item @emph{Example}:
1173 @smallexample
1174 program test_besyn
1175   real(8) :: x = 1.0_8
1176   x = besyn(5,x)
1177 end program test_besyn
1178 @end smallexample
1179
1180 @item @emph{Specific names}:
1181 @multitable @columnfractions .24 .24 .24 .24
1182 @item Name               @tab Argument            @tab Return type     @tab Option
1183 @item @code{DBESYN(N,X)} @tab @code{INTEGER(*) N} @tab @code{REAL(8)}  @tab gnu
1184 @item                    @tab @code{REAL(8)    X} @tab                 @tab 
1185 @end multitable
1186 @end table
1187
1188
1189 @node COS
1190 @section @code{COS} --- Cosine function 
1191 @findex @code{COS} intrinsic
1192 @findex @code{DCOS} intrinsic
1193 @findex @code{ZCOS} intrinsic
1194 @findex @code{CDCOS} intrinsic
1195 @cindex cosine
1196
1197 @table @asis
1198 @item @emph{Description}:
1199 @code{COS(X)} computes the cosine of @var{X}.
1200
1201 @item @emph{Option}:
1202 f95, gnu
1203
1204 @item @emph{Type}:
1205 elemental function
1206
1207 @item @emph{Syntax}:
1208 @code{X = COS(X)}
1209
1210 @item @emph{Arguments}:
1211 @multitable @columnfractions .15 .80
1212 @item @var{X} @tab The type shall be an @code{REAL(*)} or
1213 @code{COMPLEX(*)}.
1214 @end multitable
1215
1216 @item @emph{Return value}:
1217 The return value has same type and kind than @var{X}.
1218
1219 @item @emph{Example}:
1220 @smallexample
1221 program test_cos
1222   real :: x = 0.0
1223   x = cos(x)
1224 end program test_cos
1225 @end smallexample
1226
1227 @item @emph{Specific names}:
1228 @multitable @columnfractions .24 .24 .24 .24
1229 @item Name            @tab Argument          @tab Return type       @tab Option
1230 @item @code{DCOS(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
1231 @item @code{CCOS(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}    @tab f95, gnu
1232 @item @code{ZCOS(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
1233 @item @code{CDCOS(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
1234 @end multitable
1235 @end table
1236
1237
1238 @node COSH
1239 @section @code{COSH} --- Hyperbolic cosine function 
1240 @findex @code{COSH} intrinsic
1241 @findex @code{DCOSH} intrinsic
1242 @cindex hyperbolic cosine
1243
1244 @table @asis
1245 @item @emph{Description}:
1246 @code{COSH(X)} computes the hyperbolic cosine of @var{X}.
1247
1248 @item @emph{Option}:
1249 f95, gnu
1250
1251 @item @emph{Type}:
1252 elemental function
1253
1254 @item @emph{Syntax}:
1255 @code{X = COSH(X)}
1256
1257 @item @emph{Arguments}:
1258 @multitable @columnfractions .15 .80
1259 @item @var{X} @tab The type shall be an @code{REAL(*)}.
1260 @end multitable
1261
1262 @item @emph{Return value}:
1263 The return value is of type @code{REAL(*)} and it is positive
1264 (@math{ \cosh (x) \geq 0 }.
1265
1266 @item @emph{Example}:
1267 @smallexample
1268 program test_cosh
1269   real(8) :: x = 1.0_8
1270   x = cosh(x)
1271 end program test_cosh
1272 @end smallexample
1273
1274 @item @emph{Specific names}:
1275 @multitable @columnfractions .24 .24 .24 .24
1276 @item Name            @tab Argument          @tab Return type       @tab Option
1277 @item @code{DCOSH(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
1278 @end multitable
1279 @end table
1280
1281
1282 @node ERF
1283 @section @code{ERF} --- Error function 
1284 @findex @code{ERF} intrinsic
1285 @cindex error function
1286
1287 @table @asis
1288 @item @emph{Description}:
1289 @code{ERF(X)} computes the error function of @var{X}.
1290
1291 @item @emph{Option}:
1292 gnu
1293
1294 @item @emph{Type}:
1295 elemental function
1296
1297 @item @emph{Syntax}:
1298 @code{X = ERF(X)}
1299
1300 @item @emph{Arguments}:
1301 @multitable @columnfractions .15 .80
1302 @item @var{X} @tab The type shall be an @code{REAL(*)}, and it shall be scalar.
1303 @end multitable
1304
1305 @item @emph{Return value}:
1306 The return value is a scalar of type @code{REAL(*)} and it is positive
1307 (@math{ - 1 \leq erf (x) \leq 1 }.
1308
1309 @item @emph{Example}:
1310 @smallexample
1311 program test_erf
1312   real(8) :: x = 0.17_8
1313   x = erf(x)
1314 end program test_erf
1315 @end smallexample
1316
1317 @item @emph{Specific names}:
1318 @multitable @columnfractions .24 .24 .24 .24
1319 @item Name            @tab Argument          @tab Return type       @tab Option
1320 @item @code{DERF(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab gnu
1321 @end multitable
1322 @end table
1323
1324
1325
1326 @node ERFC
1327 @section @code{ERFC} --- Error function 
1328 @findex @code{ERFC} intrinsic
1329 @cindex error function
1330
1331 @table @asis
1332 @item @emph{Description}:
1333 @code{ERFC(X)} computes the complementary error function of @var{X}.
1334
1335 @item @emph{Option}:
1336 gnu
1337
1338 @item @emph{Type}:
1339 elemental function
1340
1341 @item @emph{Syntax}:
1342 @code{X = ERFC(X)}
1343
1344 @item @emph{Arguments}:
1345 @multitable @columnfractions .15 .80
1346 @item @var{X} @tab The type shall be an @code{REAL(*)}, and it shall be scalar.
1347 @end multitable
1348
1349 @item @emph{Return value}:
1350 The return value is a scalar of type @code{REAL(*)} and it is positive
1351 (@math{ 0 \leq erfc (x) \leq 2 }.
1352
1353 @item @emph{Example}:
1354 @smallexample
1355 program test_erfc
1356   real(8) :: x = 0.17_8
1357   x = erfc(x)
1358 end program test_erfc
1359 @end smallexample
1360
1361 @item @emph{Specific names}:
1362 @multitable @columnfractions .24 .24 .24 .24
1363 @item Name            @tab Argument          @tab Return type       @tab Option
1364 @item @code{DERFC(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab gnu
1365 @end multitable
1366 @end table
1367
1368
1369
1370 @node EXP
1371 @section @code{EXP} --- Exponential function 
1372 @findex @code{EXP} intrinsic
1373 @findex @code{DEXP} intrinsic
1374 @findex @code{ZEXP} intrinsic
1375 @findex @code{CDEXP} intrinsic
1376 @cindex exponential
1377
1378 @table @asis
1379 @item @emph{Description}:
1380 @code{EXP(X)} computes the base @math{e} exponential of @var{X}.
1381
1382 @item @emph{Option}:
1383 f95, gnu
1384
1385 @item @emph{Type}:
1386 elemental function
1387
1388 @item @emph{Syntax}:
1389 @code{X = EXP(X)}
1390
1391 @item @emph{Arguments}:
1392 @multitable @columnfractions .15 .80
1393 @item @var{X} @tab The type shall be an @code{REAL(*)} or
1394 @code{COMPLEX(*)}.
1395 @end multitable
1396
1397 @item @emph{Return value}:
1398 The return value has same type and kind than @var{X}.
1399
1400 @item @emph{Example}:
1401 @smallexample
1402 program test_exp
1403   real :: x = 1.0
1404   x = exp(x)
1405 end program test_exp
1406 @end smallexample
1407
1408 @item @emph{Specific names}:
1409 @multitable @columnfractions .24 .24 .24 .24
1410 @item Name            @tab Argument          @tab Return type       @tab Option
1411 @item @code{DEXP(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
1412 @item @code{CEXP(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}    @tab f95, gnu
1413 @item @code{ZEXP(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
1414 @item @code{CDEXP(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
1415 @end multitable
1416 @end table
1417
1418
1419 @node LOG
1420 @section @code{LOG} --- Logarithm function
1421 @findex @code{LOG} intrinsic
1422 @findex @code{ALOG} intrinsic
1423 @findex @code{DLOG} intrinsic
1424 @findex @code{CLOG} intrinsic
1425 @findex @code{ZLOG} intrinsic
1426 @findex @code{CDLOG} intrinsic
1427 @cindex logarithm
1428
1429 @table @asis
1430 @item @emph{Description}:
1431 @code{LOG(X)} computes the logarithm of @var{X}.
1432
1433 @item @emph{Option}:
1434 f95, gnu
1435
1436 @item @emph{Type}:
1437 elemental function
1438
1439 @item @emph{Syntax}:
1440 @code{X = LOG(X)}
1441
1442 @item @emph{Arguments}:
1443 @multitable @columnfractions .15 .80
1444 @item @var{X} @tab The type shall be an @code{REAL(*)} or
1445 @code{COMPLEX(*)}.
1446 @end multitable
1447
1448 @item @emph{Return value}:
1449 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
1450 The kind type parameter is the same as @var{X}.
1451
1452 @item @emph{Example}:
1453 @smallexample
1454 program test_log
1455   real(8) :: x = 1.0_8
1456   complex :: z = (1.0, 2.0)
1457   x = log(x)
1458   z = log(z)
1459 end program test_log
1460 @end smallexample
1461
1462 @item @emph{Specific names}:
1463 @multitable @columnfractions .24 .24 .24 .24
1464 @item Name            @tab Argument          @tab Return type       @tab Option
1465 @item @code{ALOG(X)}  @tab @code{REAL(4) X}  @tab @code{REAL(4)}    @tab f95, gnu
1466 @item @code{DLOG(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
1467 @item @code{CLOG(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}    @tab f95, gnu
1468 @item @code{ZLOG(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
1469 @item @code{CDLOG(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
1470 @end multitable
1471 @end table
1472
1473
1474
1475 @node LOG10
1476 @section @code{LOG10} --- Base 10 logarithm function
1477 @findex @code{LOG10} intrinsic
1478 @findex @code{ALOG10} intrinsic
1479 @findex @code{DLOG10} intrinsic
1480 @cindex logarithm
1481
1482 @table @asis
1483 @item @emph{Description}:
1484 @code{LOG10(X)} computes the base 10 logarithm of @var{X}.
1485
1486 @item @emph{Option}:
1487 f95, gnu
1488
1489 @item @emph{Type}:
1490 elemental function
1491
1492 @item @emph{Syntax}:
1493 @code{X = LOG10(X)}
1494
1495 @item @emph{Arguments}:
1496 @multitable @columnfractions .15 .80
1497 @item @var{X} @tab The type shall be an @code{REAL(*)} or
1498 @code{COMPLEX(*)}.
1499 @end multitable
1500
1501 @item @emph{Return value}:
1502 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
1503 The kind type parameter is the same as @var{X}.
1504
1505 @item @emph{Example}:
1506 @smallexample
1507 program test_log10
1508   real(8) :: x = 10.0_8
1509   x = log10(x)
1510 end program test_log10
1511 @end smallexample
1512
1513 @item @emph{Specific names}:
1514 @multitable @columnfractions .24 .24 .24 .24
1515 @item Name            @tab Argument          @tab Return type       @tab Option
1516 @item @code{ALOG10(X)}  @tab @code{REAL(4) X}  @tab @code{REAL(4)}    @tab f95, gnu
1517 @item @code{DLOG10(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
1518 @end multitable
1519 @end table
1520
1521
1522
1523 @node SIN
1524 @section @code{SIN} --- Sine function 
1525 @findex @code{SIN} intrinsic
1526 @findex @code{DSIN} intrinsic
1527 @findex @code{ZSIN} intrinsic
1528 @findex @code{CDSIN} intrinsic
1529 @cindex sine
1530
1531 @table @asis
1532 @item @emph{Description}:
1533 @code{SIN(X)} computes the sine of @var{X}.
1534
1535 @item @emph{Option}:
1536 f95, gnu
1537
1538 @item @emph{Type}:
1539 elemental function
1540
1541 @item @emph{Syntax}:
1542 @code{X = SIN(X)}
1543
1544 @item @emph{Arguments}:
1545 @multitable @columnfractions .15 .80
1546 @item @var{X} @tab The type shall be an @code{REAL(*)} or
1547 @code{COMPLEX(*)}.
1548 @end multitable
1549
1550 @item @emph{Return value}:
1551 The return value has same type and king than @var{X}.
1552
1553 @item @emph{Example}:
1554 @smallexample
1555 program test_sin
1556   real :: x = 0.0
1557   x = sin(x)
1558 end program test_sin
1559 @end smallexample
1560
1561 @item @emph{Specific names}:
1562 @multitable @columnfractions .24 .24 .24 .24
1563 @item Name            @tab Argument          @tab Return type       @tab Option
1564 @item @code{DSIN(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
1565 @item @code{CSIN(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}    @tab f95, gnu
1566 @item @code{ZSIN(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
1567 @item @code{CDSIN(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
1568 @end multitable
1569 @end table
1570
1571
1572
1573
1574 @node SINH
1575 @section @code{SINH} --- Hyperbolic sine function 
1576 @findex @code{SINH} intrinsic
1577 @findex @code{DSINH} intrinsic
1578 @cindex hyperbolic sine
1579
1580 @table @asis
1581 @item @emph{Description}:
1582 @code{SINH(X)} computes the hyperbolic sine of @var{X}.
1583
1584 @item @emph{Option}:
1585 f95, gnu
1586
1587 @item @emph{Type}:
1588 elemental function
1589
1590 @item @emph{Syntax}:
1591 @code{X = SINH(X)}
1592
1593 @item @emph{Arguments}:
1594 @multitable @columnfractions .15 .80
1595 @item @var{X} @tab The type shall be an @code{REAL(*)}.
1596 @end multitable
1597
1598 @item @emph{Return value}:
1599 The return value is of type @code{REAL(*)}.
1600
1601 @item @emph{Example}:
1602 @smallexample
1603 program test_sinh
1604   real(8) :: x = - 1.0_8
1605   x = sinh(x)
1606 end program test_sinh
1607 @end smallexample
1608
1609 @item @emph{Specific names}:
1610 @multitable @columnfractions .24 .24 .24 .24
1611 @item Name            @tab Argument          @tab Return type       @tab Option
1612 @item @code{DSINH(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
1613 @end multitable
1614 @end table
1615
1616
1617
1618 @node SQRT
1619 @section @code{SQRT} --- Square-root function
1620 @findex @code{SQRT} intrinsic
1621 @findex @code{DSQRT} intrinsic
1622 @findex @code{CSQRT} intrinsic
1623 @findex @code{ZSQRT} intrinsic
1624 @findex @code{CDSQRT} intrinsic
1625 @cindex square-root
1626
1627 @table @asis
1628 @item @emph{Description}:
1629 @code{SQRT(X)} computes the square root of @var{X}.
1630
1631 @item @emph{Option}:
1632 f95, gnu
1633
1634 @item @emph{Type}:
1635 elemental function
1636
1637 @item @emph{Syntax}:
1638 @code{X = SQRT(X)}
1639
1640 @item @emph{Arguments}:
1641 @multitable @columnfractions .15 .80
1642 @item @var{X} @tab The type shall be an @code{REAL(*)} or
1643 @code{COMPLEX(*)}.
1644 @end multitable
1645
1646 @item @emph{Return value}:
1647 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
1648 The kind type parameter is the same as @var{X}.
1649
1650 @item @emph{Example}:
1651 @smallexample
1652 program test_sqrt
1653   real(8) :: x = 2.0_8
1654   complex :: z = (1.0, 2.0)
1655   x = sqrt(x)
1656   z = sqrt(z)
1657 end program test_sqrt
1658 @end smallexample
1659
1660 @item @emph{Specific names}:
1661 @multitable @columnfractions .24 .24 .24 .24
1662 @item Name            @tab Argument          @tab Return type       @tab Option
1663 @item @code{DSQRT(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
1664 @item @code{CSQRT(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}    @tab f95, gnu
1665 @item @code{ZSQRT(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
1666 @item @code{CDSQRT(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
1667 @end multitable
1668 @end table
1669
1670
1671
1672 @node TAN
1673 @section @code{TAN} --- Tangent function
1674 @findex @code{TAN} intrinsic
1675 @findex @code{DTAN} intrinsic
1676 @cindex tangent
1677
1678 @table @asis
1679 @item @emph{Description}:
1680 @code{TAN(X)} computes the tangent of @var{X}.
1681
1682 @item @emph{Option}:
1683 f95, gnu
1684
1685 @item @emph{Type}:
1686 elemental function
1687
1688 @item @emph{Syntax}:
1689 @code{X = TAN(X)}
1690
1691 @item @emph{Arguments}:
1692 @multitable @columnfractions .15 .80
1693 @item @var{X} @tab The type shall be an @code{REAL(*)}.
1694 @end multitable
1695
1696 @item @emph{Return value}:
1697 The return value is of type @code{REAL(*)}.  The kind type parameter is
1698 the same as @var{X}.
1699
1700 @item @emph{Example}:
1701 @smallexample
1702 program test_tan
1703   real(8) :: x = 0.165_8
1704   x = tan(x)
1705 end program test_tan
1706 @end smallexample
1707
1708 @item @emph{Specific names}:
1709 @multitable @columnfractions .24 .24 .24 .24
1710 @item Name            @tab Argument          @tab Return type       @tab Option
1711 @item @code{DTAN(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
1712 @end multitable
1713 @end table
1714
1715
1716 @node TANH
1717 @section @code{TANH} --- Hyperbolic tangent function 
1718 @findex @code{TANH} intrinsic
1719 @findex @code{DTANH} intrinsic
1720 @cindex hyperbolic tangent
1721
1722 @table @asis
1723 @item @emph{Description}:
1724 @code{TANH(X)} computes the hyperbolic tangent of @var{X}.
1725
1726 @item @emph{Option}:
1727 f95, gnu
1728
1729 @item @emph{Type}:
1730 elemental function
1731
1732 @item @emph{Syntax}:
1733 @code{X = TANH(X)}
1734
1735 @item @emph{Arguments}:
1736 @multitable @columnfractions .15 .80
1737 @item @var{X} @tab The type shall be an @code{REAL(*)}.
1738 @end multitable
1739
1740 @item @emph{Return value}:
1741 The return value is of type @code{REAL(*)} and lies in the range
1742 @math{ - 1 \leq tanh(x) \leq 1 }.
1743
1744 @item @emph{Example}:
1745 @smallexample
1746 program test_tanh
1747   real(8) :: x = 2.1_8
1748   x = tanh(x)
1749 end program test_tanh
1750 @end smallexample
1751
1752 @item @emph{Specific names}:
1753 @multitable @columnfractions .24 .24 .24 .24
1754 @item Name            @tab Argument          @tab Return type       @tab Option
1755 @item @code{DTANH(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
1756 @end multitable
1757 @end table
1758
1759
1760
1761
1762
1763 @comment gen   bit_size 
1764 @comment 
1765 @comment gen   btest
1766 @comment 
1767 @comment gen   ceiling
1768 @comment 
1769 @comment gen   char
1770 @comment 
1771 @comment gen   cmplx 
1772 @comment 
1773 @comment gen   command_argument_count
1774 @comment 
1775 @comment gen   conjg
1776 @comment       dconjg
1777 @comment 
1778 @comment gen   count
1779 @comment 
1780 @comment sub   cpu_time
1781 @comment 
1782 @comment gen   cshift
1783 @comment 
1784 @comment sub   date_and_time
1785 @comment 
1786 @comment gen   dble 
1787 @comment       dfloat
1788 @comment 
1789 @comment gen   dcmplx
1790 @comment 
1791 @comment gen   digits
1792 @comment 
1793 @comment gen   dim
1794 @comment       idim
1795 @comment       ddim
1796 @comment 
1797 @comment gen   dot_product
1798 @comment 
1799 @comment gen   dprod
1800 @comment 
1801 @comment gen   dreal 
1802 @comment 
1803 @comment sub   dtime
1804 @comment 
1805 @comment gen   eoshift
1806 @comment 
1807 @comment gen   epsilon
1808 @comment 
1809 @comment gen   etime
1810 @comment sub   etime
1811 @comment 
1812 @comment sub   exit
1813 @comment 
1814 @comment gen   exponent
1815 @comment 
1816 @comment gen   floor
1817 @comment 
1818 @comment sub   flush
1819 @comment 
1820 @comment gen   fnum
1821 @comment 
1822 @comment gen   fraction
1823 @comment 
1824 @comment gen   fstat
1825 @comment sub   fstat
1826 @comment 
1827 @comment sub   getarg
1828 @comment 
1829 @comment gen   getcwd
1830 @comment sub   getcwd
1831 @comment 
1832 @comment sub   getenv
1833 @comment 
1834 @comment gen   getgid
1835 @comment 
1836 @comment gen   getpid
1837 @comment 
1838 @comment gen   getuid
1839 @comment 
1840 @comment sub   get_command
1841 @comment 
1842 @comment sub   get_command_argument
1843 @comment 
1844 @comment sub   get_environment_variable
1845 @comment 
1846 @comment gen   huge
1847 @comment 
1848 @comment gen   iachar
1849 @comment 
1850 @comment gen   iand
1851 @comment 
1852 @comment gen   iargc
1853 @comment 
1854 @comment gen   ibclr
1855 @comment 
1856 @comment gen   ibits
1857 @comment 
1858 @comment gen   ibset
1859 @comment 
1860 @comment gen   ichar
1861 @comment 
1862 @comment gen   ieor
1863 @comment 
1864 @comment gen   index
1865 @comment 
1866 @comment gen   int
1867 @comment       ifix
1868 @comment       idint
1869 @comment 
1870 @comment gen   ior
1871 @comment 
1872 @comment gen   irand
1873 @comment 
1874 @comment gen   ishft
1875 @comment 
1876 @comment gen   ishftc
1877 @comment 
1878 @comment gen   kind
1879 @comment 
1880 @comment gen   lbound
1881 @comment 
1882 @comment gen   len
1883 @comment 
1884 @comment gen   len_trim
1885 @comment 
1886 @comment gen   lge
1887 @comment 
1888 @comment gen   lgt
1889 @comment 
1890 @comment gen   lle
1891 @comment 
1892 @comment gen   llt
1893 @comment 
1894 @comment gen   logical
1895 @comment 
1896 @comment gen   matmul
1897 @comment 
1898 @comment gen   max
1899 @comment       max0
1900 @comment       amax0
1901 @comment       amax1
1902 @comment       max1
1903 @comment       dmax1
1904 @comment 
1905 @comment gen   maxexponent
1906 @comment 
1907 @comment gen   maxloc
1908 @comment 
1909 @comment gen   maxval
1910 @comment 
1911 @comment gen   merge
1912 @comment 
1913 @comment gen   min
1914 @comment       min0
1915 @comment       amin0
1916 @comment       amin1
1917 @comment       min1
1918 @comment       dmin1
1919 @comment 
1920 @comment gen   minexponent
1921 @comment 
1922 @comment gen   minloc
1923 @comment 
1924 @comment gen   minval
1925 @comment 
1926 @comment gen   mod
1927 @comment       amod
1928 @comment       dmod
1929 @comment 
1930 @comment gen   modulo
1931 @comment 
1932 @comment sub   mvbits
1933 @comment 
1934 @comment gen   nearest
1935 @comment 
1936 @comment gen   nint
1937 @comment       idnint
1938 @comment 
1939 @comment gen   not
1940 @comment 
1941 @comment gen   null
1942 @comment 
1943 @comment gen   pack
1944 @comment 
1945 @comment gen   precision
1946 @comment 
1947 @comment gen   present
1948 @comment 
1949 @comment gen   product
1950 @comment 
1951 @comment gen   radix
1952 @comment 
1953 @comment gen   rand
1954 @comment       ran 
1955 @comment 
1956 @comment sub   random_number
1957 @comment 
1958 @comment sub   random_seed
1959 @comment 
1960 @comment gen   range
1961 @comment 
1962 @comment gen   real
1963 @comment       float
1964 @comment       sngl
1965 @comment 
1966 @comment gen   repeat
1967 @comment 
1968 @comment gen   reshape
1969 @comment 
1970 @comment gen   rrspacing
1971 @comment 
1972 @comment gen   scale
1973 @comment 
1974 @comment gen   scan
1975 @comment 
1976 @comment gen   second
1977 @comment sub   second
1978 @comment 
1979 @comment gen   selected_int_kind
1980 @comment 
1981 @comment gen   selected_real_kind
1982 @comment 
1983 @comment gen   set_exponent
1984 @comment 
1985 @comment gen   shape
1986 @comment 
1987 @comment gen   sign
1988 @comment       isign
1989 @comment       dsign
1990 @comment 
1991 @comment gen   size
1992 @comment 
1993 @comment gen   spacing
1994 @comment 
1995 @comment gen   spread
1996 @comment 
1997 @comment sub   srand
1998 @comment 
1999 @comment gen   stat
2000 @comment sub   stat
2001 @comment 
2002 @comment gen   sum
2003 @comment 
2004 @comment gen   system
2005 @comment sub   system
2006 @comment 
2007 @comment sub system_clock
2008 @comment 
2009 @comment gen   tiny
2010 @comment 
2011 @comment gen   transfer
2012 @comment 
2013 @comment gen   transpose
2014 @comment 
2015 @comment gen   trim
2016 @comment 
2017 @comment gen   ubound
2018 @comment 
2019 @comment gen   umask
2020 @comment sub   umask
2021 @comment 
2022 @comment gen   unlink
2023 @comment sub   unlink
2024 @comment 
2025 @comment gen   unpack
2026 @comment 
2027 @comment gen   verify
2028