So we have to use this, below:
scaledValue = voltValue * deltaY / deltaX;
in order to scale an analog value but the value was erratic so we then use:
scaledValue = (long) voltValue * deltaY / deltaX;
Why do we need to use casting in this scenario? Is it due to the order of which BODMAS is carried out???