LOGICAL Function

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

Syntax

result = LOGICAL (l [, kind])

l
(Input) Must be of type logical.

kind
(Optional; input) Must be a scalar integer initialization 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 option /integer_size can affect this function.

Compatibility

CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB

See Also: CMPLX, INT, REAL

Examples

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 kind parameter of INTEGER(KIND=2).