What is num.nan? in Ruby?
The num.nan? function returns true if the num is Not a Number (NaN), and false otherwise.
Syntax
num.nan?
# where num is to be checked for nan
Parameter
This function does not require a parameter.
Return value
This function returns true if the num is not a number (NaN). Otherwise, it returns false.
Code
#Not nan valuenum1=0.00puts "num1.nan? : #{num1.nan?}\n"#nan valuenum2=0.00/0.00puts "num2.nan? : #{num2.nan?}\n"