1

Possible Duplicate:
postfix 'd+0' in Fortran real literal expressions

I have this code line in Fortran 90:

OVERN2 = 1.d+0/DBLE(FLOAT(NMODE2))

NMODE2 is an integer, OVERN2 is a REAL*8.

Can you please explain to me what this line does? I don't understand the .d+0/ part? if you can also translate that to C or any other easier language.

Community
  • 1
  • 1
badmanjoe
  • 91
  • 2
  • 4
  • 2
    This looks like the same question as http://stackoverflow.com/questions/913816/postfix-d0-in-fortran-real-literal-expressions – FJT Sep 24 '12 at 14:59
  • 1
    Also see: http://stackoverflow.com/questions/10520819/what-does-real8-mean/10521611 and http://stackoverflow.com/questions/5263157/getting-double-precision-in-fortran-90-using-intel-11-1-compiler/5267505 – M. S. B. Sep 24 '12 at 15:42

1 Answers1

2

1.d+0 is just a double precision literal in scientific notation, i.e. 1.0e0 or just 1.0.

In C it would be:

double overn2 = 1.0 / (double)nmode2;
Paul R
  • 208,748
  • 37
  • 389
  • 560