* avoid overflow error in ispowerof2 for -2^bitsize, the routine does not handle negative values

git-svn-id: trunk@37963 -
This commit is contained in:
florian 2018-01-13 22:03:29 +00:00
parent 5c1df42fa4
commit 823c77e6cc

View File

@ -910,7 +910,7 @@ implementation
return if value is a power of 2. And if correct return the power
}
begin
if (value = 0) or (value and (value - 1) <> 0) then
if (value <= 0) or (value and (value - 1) <> 0) then
exit(false);
power:=BsfQWord(value);
result:=true;