<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>
In Math Words in 32-bit library
Performs a logical shift of the double value x on the stack left by count bits, yielding the unsigned double value y.
100. 5 D<< D. (displays 3200) -100. 5 D<< D. (displays -3200)
100. 5 D<< D.
-100. 5 D<< D.
The value of y doubles with each shift. Zeros are shifted in from the least significant bit. Note that count is a single value, not a double.
Care should be taken when shifting signed values (or rather, values that are to be interpreted as signed values) since the sign of the value (as dictated by the most significant bit) may change as a result of the shift.