Possible tests:
ff.floor =3D=3D ff
ff % 1 =3D=3D 0

If x is always an integer i would use the mod operator ( x % w =3D=3D 0
=3D=3D> x/w integer)

2011/12/14 Ronnie Aa <liquid98 / gmail.com>:
> Hi,
>
> I'm looking for a way to pick out the whole numbers (ff) in the function
> below:
>
>
> x =3D 17
> w =3D 4.000
>
> while x > 0
>
> =A0ff =3D x / w
>
> =A0 =A0if ff > 0 and ff.is_a? wholenumber
> =A0 =A0 =A0 =A0 puts " #{ff} is a whole number"
> =A0 =A0end
> =A0x -=3D 1
>
> end
>
> Thanx
>
> Liquid
>
> --
> Posted via http://www.ruby-forum.com/.
>