CASTLOGICAL

Purpose:

Explicitly casts the input to a logical integer.

Syntax:

CASTLOGICAL(val)

val

-

A scalar, series or table.

Returns:

A logical integer with a value of 1 or 0.

Example:

castlogical(1.9)

 

returns the logical integer 1.

Example:

castlogical(1 + 2i)

 

returns the logical integer 1.

Example:

castlogical(0 + 0i)

 

returns the logical integer 0.

Remarks:

CASTLOGICAL always returns an integer.

 

CASTLOGICAL is helpful when writing SPL functions that require an explicit logical integer input and the type of the variable passed into the function may not be an integer.

 

CASTLOGICAL only converts the first point of a series input.

 

See LOGICAL to convert a series of values to a logical series.

See Also:

CASTCOMPLEX

CASTHANDLE

CASTREAL

CASTSERIES

CASTSTRING

CASTWINDOW

INT

ISLOGICAL

LOGICAL