java-semantics icon indicating copy to clipboard operation
java-semantics copied to clipboard

division by zero exception

Open rschumi0 opened this issue 4 years ago • 0 comments

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);

rschumi0 avatar Mar 01 '20 00:03 rschumi0