Skip to content

MDN002 double-precision-literal ​

warning opt-in

A double precision literal with exponent letter d (1.0d0).

Why ​

1.0d0 ties the constant to double precision whatever the kind of the expression it appears in; 1.0_rk follows the project's kind parameter.

Reported ​

fortran
x = 1.0d-3

Preferred ​

fortran
x = 1.0e-3_rk

Suppressing ​

For one occurrence, with the reason on the same line (or alone on the line before the statement):

fortran
! fobis: ignore[MDN002] <why this occurrence is fine>

For the whole project, ignore = MDN002 in the fobos [lint] section.

Equivalent ​

Fortitude rule MOD002 (see Lint Rules).