comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Constructing integer variables from two bytes?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Constructing integer variables from two bytes? [message #78604] Tue, 06 December 2011 21:46
Jared Espley is currently offline  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
[Message index]
 
Read Message
Previous Topic: Re: get localhost ip address
Next Topic: interpolation

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 16:02:48 PDT 2025

Total time taken to generate the page: 0.00372 seconds