fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. for (int i = 0; i <= 9; ++i) {
  13. System.out.println(i / 9.0);
  14. }
  15.  
  16. System.out.println("=======");
  17.  
  18. for (double i = 0; i <= 1; i += 1.0 / 9.0) {
  19. System.out.println(i);
  20. }
  21. }
  22. }
Success #stdin #stdout 0.12s 320576KB
stdin
Standard input is empty
stdout
0.0
0.1111111111111111
0.2222222222222222
0.3333333333333333
0.4444444444444444
0.5555555555555556
0.6666666666666666
0.7777777777777778
0.8888888888888888
1.0
=======
0.0
0.1111111111111111
0.2222222222222222
0.3333333333333333
0.4444444444444444
0.5555555555555556
0.6666666666666667
0.7777777777777779
0.8888888888888891