ash

Performs an arithmetic shift on the binary representation of its first argument.

ash shifts integer1 arithmetically left by count bit positions if count is positive, or right count bit positions if count is negative.  The shifted value of the same sign as integer1 is returned.

When ash moves bits to the left, it adds zero-bits at the right.  When it moves them to the right, it discards bits.

ash is defined to behave as if integer1 were represented in two’s complement form, regardless of how integers are actually represented.

ash(8, 1)
⇒ 16
ash(32, -1)
⇒ 16

Exported from

Modifiers

sealed

Arguments

integer1An instance of <general-integer>.
countAn instance of <integer>.

Values

integer2An instance of <general-integer>.
Performs an arithmetic shift on the binary representation of its first argument.
The common-dylan module.
Whenever possible, we have tried to keep the Dylan module pristine and unextended, preferring to add our extensions to separate modules or libraries.
Parent class of all integers.
The class of integers.