02.07.2013 Views

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Data types and data objects<br />

Intrinsic data types<br />

Following are examples of real constants:<br />

3.4E-4 !0.00034<br />

42.E2 !4200<br />

1.234_8 !1.234 with approximately 15 digits precision<br />

-2.53Q-300 !-2.53 x 10 to the -300th, with approximately 34<br />

! digits precision<br />

Complex constants<br />

A complex literal constant has the form:<br />

(real-part, imaginary-part)<br />

real-part and imaginary-part<br />

36<br />

are each one of:<br />

signed-integer-literal-constant<br />

signed-real-literal-constant<br />

The kind parameter of the complex value corresponds to the kind parameter of the part with<br />

the larger storage requirement.<br />

Following are examples of complex constants:<br />

(1.0E2, 2.3E-2) !default complex value<br />

(3.0_8,4.2_4) !complex value with KIND=8<br />

Character constants<br />

A character literal constant is one of:<br />

[kind-parameter_]'character-string'<br />

[kind-parameter_]"character-string"<br />

The delimiting characters are not part of the constant. If you need to place a single quote in a<br />

string delimited by single quotes, use two single quotes; the same rule applies for double<br />

quotes.<br />

Following are examples of character constants:<br />

1_'A.N.Other'<br />

'Bach''s Preludes' ! actual constant is: Bach's Preludes<br />

"" ! a zero length constant<br />

Chapter 3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!