What are the other NaN values?

后端 未结 3 1373
悲&欢浪女
悲&欢浪女 2020-12-11 03:38

The documentation for java.lang.Double.NaN says that it is

A constant holding a Not-a-Number (NaN) value of type double. It is equivalent

3条回答
  •  误落风尘
    2020-12-11 04:24

    Java uses IEEE 754 for its floating point numbers and therefore follows their rules.

    According to the Wikipedia page on NaN it is defined like this:

    A bit-wise example of a IEEE floating-point standard single precision NaN: x111 1111 1axx xxxx xxxx xxxx xxxx xxxx where x means don't care.

    So there are quite a few bit-patterns all of which are NaN values.

提交回复
热议问题