QB64 has had _Shl and Shr for a while now, they are useful for quick multiply/divide by a power of 2, here'a factorial using only addition/subtraction and shifts
I can't think of a practical use for rol and ror
I can't think of a practical use for rol and ror
Code: (Select All)
Dim As _Integer64 N, b, c, p
Dim As Long i
For i = 0 To 20
N = i
c = N - 1
p = 1
While c > 0
p = 0
b = c
While b > 0
If b And 1 Then
p = p + N
End If
b = _ShR(b, 1)
N = _ShL(N, 1)
Wend
N = p
c = c - 1
Wend
Print i; "! = "; p
Next