java-semantics
java-semantics copied to clipboard
division by zero exception
I noticed that kjtest.sh produces a generator error, when a division by zero is performed, which makes it really difficult to find the problem. Would it be possible that kjtest checks, if the same exception is produced by Java?
int a =0;
int b = 234;
int c = b / a;
System.out.println(""+c);
Moreover, in some cases K-Java reports a division by zero exception, even though it should not, since the result should be Infinity, when the computation is done with doubles or floats.
int a =0;
double b = 234;
double c = b / a;
System.out.println(""+c);