Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Fortran 90 Programmer's Reference: HP Fortran 90 Programmer's Reference > Chapter 10 HP Fortran 90 statements

DOUBLE PRECISION

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

Declares entities of type double precision.

Syntax

DOUBLE PRECISION [ [, attrib-list] ::] entity-list
attrib-list

is a list of one or more of the following attributes, separated by commas:

ALLOCATABLE

INTRINSIC

PRIVATE

DIMENSION

OPTIONAL

PUBLIC

EXTERNAL

PARAMETER

SAVE

INTENT

POINTER

TARGET

If attrib-list is present, it must be followed by the double colon. For information about individual attributes, see the corresponding statement in this chapter.

entity-list

is a list of entities, separated by commas. Each entity takes the form:

name [( array-spec )] [= initialization-expr]

where:

name

is the name of a variable or function

array-spec

is a comma-separated list of dimension bounds

initialization-expr

is a real constant expression that can be evaluated at compile time. If initialization-expr is present, entity-list must be preceded by the double colon.

Description

The DOUBLE PRECISION statement is used to declare the properties of real data that has greater precision than data of default type real. By default, the DOUBLE PRECISION statement is equivalent to the REAL(KIND=8) statement.

The DOUBLE PRECISION statement is constrained by the rules for type declaration statements, including the requirement that it precede all executable statements. Note, however, that the DOUBLE PRECISION statement does not have a kind parameter.

Examples

The following are valid declarations:

DOUBLE PRECISION x, y
DOUBLE PRECISION, PARAMETER :: pi=3.1415927D0
! use an array constructor to initialize a double precision array
DOUBLE PRECISION, DIMENSION(4) :: dp_vec= &
(/4.7D0, 5.2D0, 3.3D0, 2.9D0/)
! use slashes as initialization delimiters, an HP extension
DOUBLE PRECISION dp1/5.28D0/, dp2/72.3D0/ ! note, no double colon

Related statements

REAL

Related concepts

For related information, see the following:

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.