Hi everyone,
i am preparing for SCJP.
System.out.println(Math.min(-0.0, +0.0)); -----> -0.0
System.out.println(Math.max(0.0, +0.0)); -------> 0.0
i understood above 2 statements
but i have doubt in 3rd statement
System.out.println(Math.min(-0.0, +0.0)==Math.max(0.0, +0.0)); -----> true.
why 3rd statment printing true value?
Math.min(-0.0, +0.0) = -0.0
Math.max(0.0, +0.0)=0.0
how -0.0 and 0.0 are equal?
one more doubt
Double.NaN == Double.NaN -----> false.
why this condition is false?
we can compare variables with doubleequals(==)operator.
Thank U