WLJS LogoWLJS Notebook

IntegerQ

IntegerQ[expr] gives True if expr is an integer, and False otherwise.

Examples

Test for integers:

IntegerQ[5]
(* True *)
IntegerQ[5.0]
(* False *)

Filter integers from a list:

Select[{1, 2.5, 3, 4.2, 5}, IntegerQ]
(* {1, 3, 5} *)

Please visit the official Wolfram Language Reference for more details.

On this page