Help needed manually calculating 3 byte integers

Flashpoint

Rear Admiral
Hey all,

I'm trying to read the 3 byte integers from the moddule.000 file.
Like most programming languages, I have support for 1,2 and 4 byte integers, but not for 3 byte.

eg. byte1: 125, byte2: 004, byte3:254

I've never had to manually calculate one before, so could someone explain to me how to do it, like I was a five year old?
Appreciation would be much.
 
But seriously, a 3 byte integer should be the same as a 4 byte integer in which the first byte is all zeros. That's the beauty of binary.
 
Not really.
If the 4th byte is being used for something else, it means that reading it as a 4 byte integer will result in different results every time and that changing value would screw up whatever value that 4th byte is holding.

In any case, I have worked it out using some silly math and all is well :)
 
Back
Top