java - Casting NaN value -


i learned nan unordered , playing float , double nan , tried following snippet:

system.out.println("comparing isnan method: " + float.isnan((float)double.nan)); 

i got question if nan not-a-number why casting of nan allowed. want know happen @ architectural level when cast nan value.

in javadoc can see double.nan constant of type double, can cast! double.nan valid number. http://docs.oracle.com/javase/7/docs/api/java/lang/double.html


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -