I have 24bit data in 3 array a[0], a[1], a[2] and need to calculate for multiply and divide by some constant and result still in 3 array.
For example, data = 999900h store in a[0] = 99, a[1] = 99, a[2] = 00
[(999900h/64)*15000]/157286 << **process???**
result will be 3A97h store in b[0] = 00, b[1] =3A, b[2] = 97
My question is
1.) How to write code for fast calculate in the process, pointer in fast? how to use pointer in the process?
2.) It possible no use conversion process like array to integer and integer to array?
I like to use unions in this case:
Please take endianess into account. use
htonlif you put in your bytes most significant – to least significant, but are on a little endian system. If you don’t want to mess around with endianess then I suggest you use one of the suggested algebraic suggestions.