Netjs
Netjs copied to clipboard
Integer casts do not truncate
The code:
int i = (int)3.14;
produces:
i = <number>3.14;
The truncation is lost.
same problem affects integer division:
int x = 502; x = x / 100;
produces
i = 5.02
those conversions (and result of division) should be treated with x >> 0
to get the integer value