Bytecoder icon indicating copy to clipboard operation
Bytecoder copied to clipboard

divide Long.MAX_VALUE by any number produces zero (WASM)

Open rammuralidhar opened this issue 2 years ago • 0 comments

public class HelloWorld {

public static void main(String[] args) throws Exception {
	int multiplier = 100;
	long cutoff = Long.MAX_VALUE / (long) multiplier;
    long cutoff1 = Long.MAX_VALUE / 100;
	System.out.println("cutoff : " + cutoff);
    System.out.println("cutoff1 : " + cutoff1);

} }

this program produces output 2061584422 0 -- this is wrong

rammuralidhar avatar Oct 13 '21 14:10 rammuralidhar