Re: Is 2.0 Integer or Float?

From: S. Robert J. [mailto:[email protected]]

I’d like to be able to do:

x = 2.0
assert x.integral?

class Numeric
def integral?
round == self

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs