parafux
Newbie level 3
Hi all,
I have two integer variables scaling_0 and scaling_1
I want to attach them so that scaling_0 are the lower 32 bit and scaling_1 are the upper 32 bit. The result should be stored in a longint variable scaling.
I try this:
scaling = longint'(scaling_0) + (longint'(scaling_1) * longint'(2**32));
or also i tried this
scaling = longint'(scaling_0) + (longint'(scaling_1) * << 32);
for scaling_0 = -1 and scaling_1 = 15 i get this result:
scaling = 0xE_FFFFFFFF
I expect 0xF_FFFFFFFF
i also tried the cast with longint unsigned but get a compiler error.
I have two integer variables scaling_0 and scaling_1
I want to attach them so that scaling_0 are the lower 32 bit and scaling_1 are the upper 32 bit. The result should be stored in a longint variable scaling.
I try this:
scaling = longint'(scaling_0) + (longint'(scaling_1) * longint'(2**32));
or also i tried this
scaling = longint'(scaling_0) + (longint'(scaling_1) * << 32);
for scaling_0 = -1 and scaling_1 = 15 i get this result:
scaling = 0xE_FFFFFFFF
I expect 0xF_FFFFFFFF
i also tried the cast with longint unsigned but get a compiler error.