RtlExtendedMagicDivide(3w)

RtlExtendedMagicDivide3w

Usage

#define RtlExtendedMagicDivide
( A )

Overview

Allows replacing a division by a longlong constant with a multiplication by the inverse constant.

Returns

(dividend * inverse_divisor) >> (64 + shift).

Notes

If the divisor of a division is constant, the constants inverse_divisor and shift must be chosen such that inverse_divisor = 2^(64 + shift) / divisor. Then we have RtlExtendedMagicDivide(dividend,inverse_divisor,shift) == dividend * inverse_divisor / 2^(64 + shift) == dividend / divisor.

The Parameter inverse_divisor although defined as LONGLONG is used as ULONGLONG.

Implementation

Declared in "winternl.h".

Implemented in "dlls/ntdll/large_int.c".

Releases

4 releases since Debian 4.0 (Etch); the text changed 3 times.

  1. 4.0
  2. 5.0
  3. 6.0
  4. 7

From libwine-dev 1.4.1-4 in Debian 7 (Wheezy). Parsed by carta from the page's man source.