Home »
Public Forums »
archive »
Constructing integer variables from two bytes?
Constructing integer variables from two bytes? [message #78604] |
Tue, 06 December 2011 21:46 |
Jared Espley
Messages: 17 Registered: February 2006
|
Junior Member |
|
|
I have data in a byte array that I would like to use to construct
arrays of unsigned integers and integers.
In code:
A = [1B, 2B]
B = 0
B = A[0]*256 + fix(A[1])
Which will give B as an integer type with a value 258.
I realize that I can construct functions to do this (multiple each bit
by the appropriate value and checking which OS we're in so that we get
endianness correct) but I was wondering if someone had already done
this rigorously?
Thanks,
Jared
|
|
|
Current Time: Wed Oct 08 15:39:12 PDT 2025
Total time taken to generate the page: 0.00566 seconds