Bytecoder
Bytecoder copied to clipboard
divide Long.MAX_VALUE by any number produces zero (WASM)
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