<<

Syntax

Description

<< shifts all bits in the argument *number* INTEGER to
the left by argument *places*. This has the effect of multiplying the
argument *number* by two for each shift given in the argument
*places*. Both arguments, *numbers* and *places* are integers.
This is easiest to see in a binary number. For example %0101 << 1
return the binary number %01010. In base 10 numbers this looks like
5 << 1 and returns 10.

Shift operations can not be used on SINGLE variables

Example

FOR i = 1 TO 10

PRINT 1 << i

NEXT i

SLEEP

PRINT 1 << i

NEXT i

SLEEP

The output would look like:

2

4

8

16

32

64

128

256

512

1024

4

8

16

32

64

128

256

512

1024

Differences from other BASICs

- none

See also