GLBasic User Manual

Main sections

ASL()

res% = ASL(num%, shift%)



Shifts the binary bits of an integer number left by shift% number of bits. Each bit shift to the left doubles num%.

a% = 3
b% = 256
a% = ASL(a%, 3) // a=a*8
b% = ASR(b%, 4) // b=b/16
PRINT "a = " + a%,0,0
PRINT "b = " + b%,0,10
SHOWSCREEN
MOUSEWAIT


Output
A = 24
B = 16

See also...