Next: , Previous: Unary operators, Up: Extensions

7.10 Implicitly interconvert LOGICAL and INTEGER

As a GNU extension for backwards compatibility 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 nonzero value is interpreted as .TRUE..

            INTEGER*4 i
            i = .FALSE.