What is right, indeed... Depends on what you are trying to do. Please read
. If you are doing ordinary arithmetic, then what you are doing is probably what you want. If you are doing something like calculating a TCP checksum, then the other method is closer to (but not exactly) what you want.