Hi, I have a thread which counts from say 1 to 1 million and it takes 60 seconds to do so. If i use four threads to do the same task , will the time be less or be the same ? According to me it should be the same since they are sharing the same CPU. Now if I use four threads on four different CPUs, should the time reduce to 15 secs ? since all thread will run together (in the real sense, no sharing of CPU) Can ne one please explain !! Thanks
Originally posted by Dan Chisholm: The Double.equals method then tests the equality of the bit representations of the values. The equals method will return true if the bit representations are the same even if the bit layout represents NaN.
Thanks Dan, Since NaN will never be equal to itself, why are their bit representation same ?? Can you please explain a little further.. [ November 19, 2002: Message edited by: Shilpa Bhargava ]
The following code will print 1: Double a = new Double(Double.NaN); 2: Double b = new Double(Double.NaN); 3: 4: if( Double.NaN == Double.NaN ) 5: System.out.println("True"); 6: else 7: System.out.println("False"); 8: 9: if( a.equals(b) ) 10: System.out.println("True"); 11: else 12: System.out.println("False"); A) True True B) True False C) False True D) False False Surprisingly the asnwer is C when it should have been the reverse. Can ne one pls explain