-1
((13 / 3 == 4) == true) 

why is this equals true? 13/3 = 4.3333 and 4.333 is not equaled 4. Is it about auto cast into an integer? and round?

I tested it in Java EE 8.

Joe Taras
  • 14,133
  • 7
  • 36
  • 51
J. H
  • 102
  • 10

1 Answers1

5

Because when you write 13 / 3 you have divided two integer, so the result is only int part, so 4.

In this way you have the next condition 4 == 4 is true

Joe Taras
  • 14,133
  • 7
  • 36
  • 51