| ILog2 Function |
Unit
QESBPCSMath
Declaration
Function ILog2(const I: LongWord): LongWord;
Description
Developed by Rory Daulton and used with Permission.
An Exception is raised if I is Zero.
| Parameters |
| I | Positive Integer Value to process. |
Category
Arithmetic Routines for IntegersImplementation
function ILog2 (const I: LongWord): LongWord;
procedure BadILog2;
begin
raise EMathError.Create (rsDivideByZero);
end {BadILog2};
asm
bsr eax,eax
jz BadILog2
End; |
|
|