1
QB64 Discussion / Re: _SHR bug with sign bit of _UNSIGNED _INTEGER64
« on: December 05, 2019, 03:34:28 am »
Finally i find a workaround based on http://qb64.org/wiki/C_Libraries#Bit_Shifting :
Modified C include file in qb64 dir :
Basic declare and a piece of code that works :
I had just to modify the types of variables and return value.
Modified C include file in qb64 dir :
Code: C: [Select]
- //ushift.h
- uint64 uShiftR(uint64 Value, unsigned ShiftValue)
- {
- return(Value >> ShiftValue);
- }
- uint64 uShiftL(uint64 Value, unsigned ShiftValue)
- {
- return(Value << ShiftValue);
- }
Code: QB64: [Select]
- 'ushift.bas
- n = &H1000000000000000
- n = uShiftL(n, 3)
- n = uShiftR(n, 3)
I had just to modify the types of variables and return value.