$ 0 0 if (x %% 1) == 0 works for values like 1.2, 2.4 or 2.But for values like 1.0, 2.0 this does not work.