Sophie

Sophie

distrib > Mandriva > 2011.0 > x86_64 > by-pkgid > f13f137693327172bf7ba9b443ff3a61 > files > 311

gcc-gfortran-4.6.1-2.x86_64.rpm

<html lang="en">
<head>
<title>SELECTED_REAL_KIND - The GNU Fortran Compiler</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="The GNU Fortran Compiler">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Intrinsic-Procedures.html#Intrinsic-Procedures" title="Intrinsic Procedures">
<link rel="prev" href="SELECTED_005fINT_005fKIND.html#SELECTED_005fINT_005fKIND" title="SELECTED_INT_KIND">
<link rel="next" href="SET_005fEXPONENT.html#SET_005fEXPONENT" title="SET_EXPONENT">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Funding Free Software'', the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
``GNU Free Documentation License''.

(a) The FSF's Front-Cover Text is:

     A GNU Manual

(b) The FSF's Back-Cover Text is:

     You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development.-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<a name="SELECTED_REAL_KIND"></a>
<a name="SELECTED_005fREAL_005fKIND"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="SET_005fEXPONENT.html#SET_005fEXPONENT">SET_EXPONENT</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="SELECTED_005fINT_005fKIND.html#SELECTED_005fINT_005fKIND">SELECTED_INT_KIND</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Intrinsic-Procedures.html#Intrinsic-Procedures">Intrinsic Procedures</a>
<hr>
</div>

<h3 class="section">8.213 <code>SELECTED_REAL_KIND</code> &mdash; Choose real kind</h3>

<p><a name="index-SELECTED_005fREAL_005fKIND-978"></a><a name="index-real-kind-979"></a><a name="index-kind_002c-real-980"></a><a name="index-radix_002c-real-981"></a>
     <dl>
<dt><em>Description</em>:<dd><code>SELECTED_REAL_KIND(P,R)</code> returns the kind value of a real data type
with decimal precision of at least <code>P</code> digits, exponent range of
at least <code>R</code>, and with a radix of <code>RADIX</code>.

     <br><dt><em>Standard</em>:<dd>Fortran 95 and later, with <code>RADIX</code> Fortran 2008 or later

     <br><dt><em>Class</em>:<dd>Transformational function

     <br><dt><em>Syntax</em>:<dd><code>RESULT = SELECTED_REAL_KIND([P, R, RADIX])</code>

     <br><dt><em>Arguments</em>:<dd>
     <p><table summary=""><tr align="left"><td valign="top" width="15%"><var>P</var> </td><td valign="top" width="70%">(Optional) shall be a scalar and of type <code>INTEGER</code>. 
<br></td></tr><tr align="left"><td valign="top" width="15%"><var>R</var> </td><td valign="top" width="70%">(Optional) shall be a scalar and of type <code>INTEGER</code>. 
<br></td></tr><tr align="left"><td valign="top" width="15%"><var>RADIX</var> </td><td valign="top" width="70%">(Optional) shall be a scalar and of type <code>INTEGER</code>.
     <br></td></tr></table>
Before Fortran 2008, at least one of the arguments <var>R</var> or <var>P</var> shall
be present; since Fortran 2008, they are assumed to be zero if absent.

     <br><dt><em>Return value</em>:<dd>
<code>SELECTED_REAL_KIND</code> returns the value of the kind type parameter of
a real data type with decimal precision of at least <code>P</code> digits, a
decimal exponent range of at least <code>R</code>, and with the requested
<code>RADIX</code>. If the <code>RADIX</code> parameter is absent, real kinds with
any radix can be returned. If more than one real data type meet the
criteria, the kind of the data type with the smallest decimal precision
is returned. If no real data type matches the criteria, the result is
          <dl>
<dt>-1 if the processor does not support a real data type with a<dd>precision greater than or equal to <code>P</code>, but the <code>R</code> and
<code>RADIX</code> requirements can be fulfilled
<br><dt>-2 if the processor does not support a real type with an exponent<dd>range greater than or equal to <code>R</code>, but <code>P</code> and <code>RADIX</code>
are fulfillable
<br><dt>-3 if <code>RADIX</code> but not <code>P</code> and <code>R</code> requirements<dd>are fulfillable
<br><dt>-4 if <code>RADIX</code> and either <code>P</code> or <code>R</code> requirements<dd>are fulfillable
<br><dt>-5 if there is no real type with the given <code>RADIX</code><dd></dl>

     <br><dt><em>See also</em>:<dd><a href="PRECISION.html#PRECISION">PRECISION</a>, <a href="RANGE.html#RANGE">RANGE</a>, <a href="RADIX.html#RADIX">RADIX</a>

     <br><dt><em>Example</em>:<dd>
     <pre class="smallexample">          program real_kinds
            integer,parameter :: p6 = selected_real_kind(6)
            integer,parameter :: p10r100 = selected_real_kind(10,100)
            integer,parameter :: r400 = selected_real_kind(r=400)
            real(kind=p6) :: x
            real(kind=p10r100) :: y
            real(kind=r400) :: z
          
            print *, precision(x), range(x)
            print *, precision(y), range(y)
            print *, precision(z), range(z)
          end program real_kinds
</pre>
     </dl>

   </body></html>