num.zero?
# where num is the number which is to be checked for zero
This function does not require a parameter.
This function returns true
if the number is zero. Otherwise, it returns false
.
#zero numberprint "(0).zero? : ",(0).zero? , "\n"print "(0.0).zero? : ",(0.0).zero? , "\n"#non-zero numberprint "(4).zero? : ", (4).zero?, "\n"print "(4.5).zero? : ", (4.5).zero?, "\n"