fork(3) 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.  
  13.  
  14. //about 1.00000001490116119384765625E-1 in IEEE-754
  15. float f = 0.1f;
  16. //about 1.00000000000000005551115123126E-1 in IEEE-754
  17. double d = 0.1d;
  18.  
  19. System.out.println(String.format("double 0.1= %.30f", d));
  20. System.out.println(String.format("float 0.1 = %.15f", f));
  21.  
  22.  
  23. }
  24. }
Success #stdin #stdout 0.11s 50712KB
stdin
Standard input is empty
stdout
double 0.1= 0.100000000000000000000000000000
float 0.1 = 0.100000001490116