nono... I'm trying to cut it...
lemme use an unsigned example...
256 & 255 = 0
1048 & 255 = 24
I expect the values that enter these classes ( bu32, bs8, s16, ... ) to be bigger than what the class can actually hold...
so in logic's terms, I'm making it fit by it's bit-width.
stranac wrote:What exactly are you trying to calculate here?
Without an explanation, your calculations make no sense.
Tcll wrote:I just need an int value that's the correct bit-width for the data.
would've been good enough :/
guess not... heh
I'm not sure how to code it exactly, and need an example... :/
an example that would take place with byte-magic on a file: (UMC script)
- Code: Select all
value = bs16( -524 )
vptr = ref( value )
deref( vptr, bs8 ) # changes 'value' from a bs16 to a bs8 (changing the internal value and data in the memory)