fork download
  1. class Main {
  2. public static void main(String[] args) {
  3. float x = 1.0f;
  4. float y = 1e-8f;
  5. float z = x + y;
  6.  
  7. System.out.printf("%g\n", x);
  8. System.out.printf("%g\n", y);
  9. System.out.printf("%g\n", z);
  10. System.out.printf("%g\n", z - x);
  11.  
  12. }
  13. }
Success #stdin #stdout 0.06s 380224KB
stdin
Standard input is empty
stdout
1.00000
1.00000e-08
1.00000
0.00000