Next: , Previous: Extensions to namelist, Up: Extensions

6.4 Implicitly interconvert LOGICAL and INTEGER

As a GNU extension for backwards compatability with other compilers, gfortran allows the implicit conversion of LOGICALs to INTEGERs and vice versa. When converting from a LOGICAL to an INTEGER, the numeric value of .FALSE. is zero, and that of .TRUE. is one. When converting from INTEGER to LOGICAL, the value zero is interpreted as .FALSE. and any non-zero value is interpreted as .TRUE..

            INTEGER*4 i
            i = .FALSE.