javaLongToInt method
Implementation
javaLongToInt(num number) {
int count = 0;
final javaMinIntAbs = javaMinInteger.abs();
final isNegative = number < 0;
number = number.abs();
if (number == javaMinIntAbs) return -number;
if (number > javaMinIntAbs) {
while (number > javaMinIntAbs) {
number -= javaMinIntAbs;
count++;
}
if (count % 2 == 1) {
number -= javaMinIntAbs;
}
}
return isNegative ? -number : number;
}