What dose d-8 mean in Fortran?

In summary, d-8 in Fortran is a data type used to represent double precision floating-point numbers, allowing for more precise and accurate calculations involving decimal numbers. To declare a variable as d-8 in Fortran, the "REAL*8" statement is used. It is supported in all versions of Fortran, but older versions may have different syntax. However, using d-8 in Fortran can have limitations such as requiring more memory and impacting program performance.
  • #1
nnnnn
5
0
What dose "d-8" mean in Fortran?

Dear friends;
What dose "d-8" mean in Fortran?
Thanks
 
Technology news on Phys.org
  • #2


2.0d-8 is the same value as 2.0e-8 except that it's stored as a double precision real number instead of single precision. In FORTRAN 77 it would be declared as REAL*16 instead of REAL*8.
 
  • #3


Much thanks to jtbell ;

you mean 2.0d-8 is equal to 2*10^ (-8) ?
 
  • #4


Yes.
 

What is d-8 in Fortran?

d-8 in Fortran refers to a specific data type known as "double precision floating-point number". It is used to represent numbers with decimal points and a wider range of values compared to other data types in Fortran.

How do you declare a variable as d-8 in Fortran?

To declare a variable as d-8 in Fortran, you would use the "REAL*8" statement before the variable name. This specifies that the variable will be of type double precision floating-point number, or d-8.

What is the significance of d-8 in Fortran?

The d-8 data type in Fortran is important because it allows for more precise and accurate calculations involving decimal numbers. It also has a wider range of values compared to other data types, making it useful for scientific and mathematical computations.

Can you use d-8 in all versions of Fortran?

Yes, the d-8 data type is supported in all versions of Fortran. However, some older versions may use a different syntax for declaring d-8 variables, such as "DOUBLE PRECISION" instead of "REAL*8". It is important to check the documentation for the specific version of Fortran you are using.

Are there any limitations to using d-8 in Fortran?

One limitation of using d-8 in Fortran is that it requires more memory compared to other data types. This can impact the performance and speed of your program, especially when dealing with large amounts of data. It is important to consider the trade-off between precision and memory usage when using d-8 in Fortran.

Similar threads

  • Programming and Computer Science
Replies
2
Views
937
  • Programming and Computer Science
Replies
12
Views
960
  • Programming and Computer Science
2
Replies
37
Views
3K
  • Programming and Computer Science
Replies
20
Views
3K
  • Programming and Computer Science
Replies
4
Views
602
  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
Replies
5
Views
1K
  • Programming and Computer Science
Replies
17
Views
4K
  • Programming and Computer Science
Replies
11
Views
9K
  • Programming and Computer Science
Replies
4
Views
2K
Back
Top