RtlExtendedMagicDivide(3w)

NAME

RtlExtendedMagicDivide (NTDLL.@)

SYNOPSIS

#define  RtlExtendedMagicDivide
 ( A )

DESCRIPTION

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

Defined in "winternl.h".

Implemented in "build/buildd-wine-unstable_1.1.32-1+b1-amd64-KnxYu0/wine-unstable-1.1.32/build32/dlls/ntdll/large_int.c".
Copyright © 2010-2025 Platon Technologies, s.r.o.           Index | Man stránky | tLDP | Dokumenty | Utilitky | O projekte
Design by styleshout