Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

LOGICAL Function

Elemental Intrinsic Function (Generic): Converts the logical value of the argument to a logical value with different kind parameters.

result = LOGICAL (l[,kind])

l

(Input) Must be of type logical.

kind

(Input; optional) Must be a scalar integer constant expression.

Results

The result is of type logical. If kind is present, the kind parameter is that specified by kind; otherwise, the kind parameter is that of default logical. The result value is that of l.

The setting of compiler options specifying integer size can affect this function.

Example

LOGICAL (L .OR. .NOT. L) has the value true and is of type default logical regardless of the kind parameter of logical variable L.

LOGICAL (.FALSE., 2) has the value false, with the parameter of kind 2.