Java isNan how it works?

后端 未结 5 1971
别那么骄傲
别那么骄傲 2021-02-04 03:04

I was looking at the openjdk-1.7.0_25 source code and I have seen this method:

/**
 * Returns {@code true} if the specified number is a
 * Not-a-Num         


        
5条回答
  •  悲&欢浪女
    2021-02-04 03:21

    As far as I know NaN value is not equal to anything.So when you passed float v,It's never not equal to it self.

提交回复
热议问题