integerdivq2exp - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

integermul2exp

multiply an integer by a power of 2

integerdivq2exp

divide an integer by a power of 2

 Calling Sequence integermul2exp(i,pow) integerdivq2exp(i,pow)

Parameters

 i - integer pow - integer

Description

 • The integerdivq2exp and integermul2exp commands provide what are considered hardware bit-shift operations.  They are fast methods for dividing or multiplying an integer by a power of 2.  integermul2exp computes i*2^pow, and integerdivq2exp calculates trunc(i / 2^pow).

 • The integermul2exp and integerdivq2exp commands are thread-safe as of Maple 2023.

Examples

 > $\mathrm{integermul2exp}\left(10,4\right)-10{2}^{4}$
 ${0}$ (1)
 > $\mathrm{integerdivq2exp}\left(255,4\right)-\mathrm{trunc}\left(\frac{255}{{2}^{4}}\right)$
 ${0}$ (2)

Compatibility

 • The integermul2exp and integerdivq2exp commands were introduced in Maple 2023.
 • For more information on Maple 2023 changes, see Updates in Maple 2023.