Skip to content

isinteger

Test whether the input is integer-typed (or, in script mode, integer-valued).

tf = isinteger(A)

In Excel-compatible mode, returns true when A’s storage type is one of the integer types (int8, int16, int32, int64, and their unsigned variants).

In script mode, returns true when A’s value is an integer regardless of storage — so isinteger(3.0) is true but isinteger(3.5) is false. Applied elementwise for arrays.

Note: this differs from MATLAB’s isinteger, which tests storage type only.

isinteger(int32(5)) % 1
isinteger(3.0) % 1 in script mode, 0 in Excel-compat
isinteger(3.5) % 0
  • isnumeric — Test whether the input is a numeric type.
  • islogical — Test whether the input is of logical (boolean) type.
  • isscalar — Test whether the input is a 1×1 scalar.