@PeteBecker Incidentally, it is actually the division and multiplication causing the problem here, plus the conversion to double, paradoxically. Only adding and subtracting in two's complement would yield the same bit patterns whether performed signed or unsigned, so that converting the result to an int (not to a float) would yield the "expected" result.
↧