fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.math.BigDecimal;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone
  10. {
  11. public static void main (String[] args) throws java.lang.Exception
  12. {
  13. BigDecimal v1 = new BigDecimal(100);
  14. BigDecimal v2 = new BigDecimal(15);
  15. BigDecimal v3 = v1.divide(v2);
  16.  
  17. System.out.println(v3);
  18. }
  19. }
Runtime error #stdin #stdout #stderr 0.04s 4386816KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Exception in thread "main" java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.
	at java.math.BigDecimal.divide(BigDecimal.java:1690)
	at Ideone.main(Main.java:15)