fork download
  1. class Ideone
  2. {
  3. public static void main (String[] args) throws java.lang.Exception
  4. {
  5. double x = 1e16;
  6. System.out.println(x + 1 + 2);
  7. System.out.println(x + 3);
  8. if (x + 1 + 2 == x + 3) {
  9. System.out.println("EQUAL");
  10. } else {
  11. System.out.println("NOT EQUAL");
  12. }
  13. }
  14. }
Success #stdin #stdout 0.1s 320512KB
stdin
Standard input is empty
stdout
1.0000000000000002E16
1.0000000000000004E16
NOT EQUAL