<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>


D<< Search:

In Math Words in 32-bit library

Word Name: D<<
Type: Standard word
Data Stack Signature: ud:x s:count – d:y
Return Stack Signature: --
Availability: V1.2
Description:

Performs a logical shift of the double value x on the stack left by count bits, yielding the unsigned double value y.

Example:

100. 5 D<< D. (displays 3200)
-100. 5 D<< D. (displays -3200)

Comment:

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.

See Also: << 

<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>