Is There a Better Double-Precision Assignment in Fortran 90?

前端 未结 2 1593
星月不相逢
星月不相逢 2020-11-29 13:12

In Fortran 90 (using gfortran on Mac OS X) if I assign a value to a double-precision variable without explicitly tacking on a kind, the precision doesn\'t \"take.\" What I

2条回答
  •  清酒与你
    2020-11-29 13:52

    A real which isn't marked as double precision will be assumed to be single precision. Just because sometime later you assign it to a double precision variable, or convert it to double precision, that doesn't mean that the value will 'magically' be double precision. It doesn't look ahead to see how the value will be used.

提交回复
热议问题