How about a union? I don't know the exact syntax off hand, but I know it will do exactly what you are trying.
Brian On Fri, Apr 1, 2011 at 4:57 AM, Pavel Shramov <[email protected]> wrote: > On Fri, Apr 01, 2011 at 09:34:20AM +0100, andy pugh wrote: >> On 1 April 2011 06:02, Pavel Shramov <[email protected]> wrote: >> >> > u32_var = ((u32) (u16) s16_var); >> > >> > u16 casts s16 to 16 bit positive number. >> >> So, (s16)-10 == 32778? > (s16) -10 == -10 > (u16) -10 == 0xfff6 > > You may check it with shell: > > $ printf '%x\n' -10 > fffffffffffffff6 > > Pavel > > ------------------------------------------------------------------------------ > Create and publish websites with WebMatrix > Use the most popular FREE web apps or write code yourself; > WebMatrix provides all the features you need to develop and > publish your website. http://p.sf.net/sfu/ms-webmatrix-sf > _______________________________________________ > Emc-developers mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/emc-developers > ------------------------------------------------------------------------------ Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
