# About NAN

Xiao Song

Greenhorn

Posts: 17

posted 9 years ago

0.0/0.0 is NaN and NaN is different from 0. Hence false.

SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master

Did a rm -R / to find out that I lost my entire Linux installation!

Xiao Song

Greenhorn

Posts: 17

posted 9 years ago

Thanks a lot.

In rt.jar NaN is defined as follows:

What is this mean??

In rt.jar NaN is defined as follows:

A constant holding the largest positive finite value of type

double,It is equal to the hexadecimal floating-point literal

0x1.fffffffffffffP+1023 and also equal to

Double.longBitsToDouble(0x7fefffffffffffffL)

What is this mean??

scjping.......

Burkhard Hassel

Ranch Hand

Posts: 1274

posted 9 years ago

Hi ranchers,

Xiao Song posted November 20, 2006 01:39 AM

So NaN - NaN = NaN

and NaN is not zero.

Furthermor NaN is unuequal to everything, including itself (this may give you some headaches if you think about it).

eg

prints

NaN

false

true

Xiao Song posted November 20, 2006 01:39 AM

when you perform arithmetic operation on NaN the result will also be not a number.Hello,everyone, Why the result is false??

So NaN - NaN = NaN

and NaN is not zero.

Furthermor NaN is unuequal to everything, including itself (this may give you some headaches if you think about it).

eg

prints

NaN

false

true

all events occur in real time