If it is an integer : nan « Number « Ruby

If it is an integer

num = 4 # => 4

if num.integer?
  puts "Invited guests: " + num.to_s
  puts "Only whole persons can come to this party."


Related examples in the same category

1.Value of not-a-number
2.Is it not a number
3.Inspect a not-a-number
4.Is it an integer