From: Szymon Rozga Date: 2006-11-15T01:50:10+09:00 Subject: Re: Is 2.0 Integer or Float? Hope the following helps: irb(main):001:0> 2.0.class => Float irb(main):002:0> 2.class => Fixnum irb(main):003:0> 2.0.is_a?(Float) => true irb(main):004:0> 2.0.is_a?(Fixnum) => false irb(main):005:0> 2.is_a?(Float) => false irb(main):006:0> 2.is_a?(Fixnum) => true -Szymon On Nov 14, 11:34 am, "S. Robert James" wrote: > I'd like to be able to do: > > x = 2.0 > assert x.integral? > > the :integer method returns false in this case. > What would be a good way to write a different method to check?