Why this output is 'True'? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why this output is 'True'?

Boolean value = -0.0==0.0; System.out.print(value); //Output True

20th Mar 2020, 3:18 AM
Rishabh Maurya
Rishabh Maurya - avatar
3 Answers
+ 3
Because zero is zero. There is no positive or negative zero.
20th Mar 2020, 4:26 AM
Arturo Fiero
Arturo Fiero - avatar
0
Yes 0 = 0 That is call 0 multi 0 = 0 No positive and no negative Right answer true
25th Jan 2023, 7:18 AM
Amit Mishra
Amit Mishra - avatar
0
Rishab bhai
25th Jan 2023, 7:18 AM
Amit Mishra
Amit Mishra - avatar