Scala Float isNaN() method with example
Last Updated :
29 Oct, 2019
The isNaN() method is utilized to return true if this Float value or the specified float value is Not-a-Number (NaN), or false otherwise.
Method Definition: (Float_Number).isNaN
Return Type: It returns true if this Float value or the specified float value is Not-a-Number (NaN), or false otherwise.
Example #1:
object GfG
{
def main(args : Array[String])
{
val result = ( 0.0 / 0.0 ).isNaN
println(result)
}
}
|
Example #2:
object GfG
{
def main(args : Array[String])
{
val result = ( 5.7 ).isNaN
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...