Shl()

From TinyMUX
Revision as of 05:09, 17 January 2006 by Ian (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Description

FUNCTION: shl(number,count)

Performs a leftwards bit-shift on number, shifting it <count> times. This is equivalent to imul(number,pow(2,count), but much faster.

Related Topics: shr(), band(), bnand(), bor(), bxor().

Examples

> think shl(2,10)
2048


(--Soylent 00:37, 3 December 2005 (EST))