Fortran real literal constants are by default single precision. It is important that care is taken when assigning a literal to a quad precision or double precision variable so that you get the expected results.
For example, consider these two assignments to B:
B = 3.1
B = 3.10000000000
If B is defined as double or quad precision, the literal constant is not. If you intend to B to contain or double or quad precision value, you need to write:
B = 3.1_8 for double precision
OR
B = 3.1_16 for quad precision
Alternatively to using the notation above, you can use compiler options /real-size:64 (double precision) or /real-size:128 (quad precision). The Windows compiler options are listed. Please see the compiler documentation for Linux* and Mac OS X* compiler options.
These are just two of many ways to set precision of real literal contants. For additional methods please consult a Fortran programming language reference manual.
This article applies to:
Intel® Fortran Compiler for Linux* Knowledge Base,
Intel® Fortran Compiler for Mac OS X* Knowledge Base,
Intel® Visual Fortran Compiler for Windows* Knowledge Base
Comments (0) 
Trackbacks (0)
Leave a comment 