On Thu, 13 Apr 2017 11:28:20 +0200
Andrea Mauri wrote:
>[...]
> procedure TBits.Setall;
> var
> loop : longint;
> begin
> for loop := 0 to FSize - 1 do
>FBits^[loop] := 1;
Should be
FBits^[loop] := not cardinal(0);
> end;
Btw, it seems TBits misses an AssignBits(b: TBits).
And
AFAIK a.NotBits(b) means (a and not b):
a b result
0 0 0
0 1 0
1 0 1
1 1 0
Mattias
Thank you Mattias.
It works as you described.
Anyway, since ClearAll, AndBits, OrBits etc works iterating on
FBits : ^TBitArray;
they are much faster then the simple iteration along property
property Bits[Bit: l
On Thu, 13 Apr 2017 10:52:44 +0200 (CEST)
Michael Van Canneyt wrote:
>[...]
> I am not sure that what you did is supported.
>
> b.notbits(b)
>
> I am not sure that you can pass the same instance to b.
Just look at the code. It's only a few lines. It is supported.
Mattias
_
On Thu, 13 Apr 2017, Andrea Mauri wrote:
any answer?
I asked in the wrong place?
where should I ask?
You asked in the right place. I just didn't notice your first mail.
I am not sure that what you did is supported.
b.notbits(b)
I am not sure that you can pass the same instance to b.
Can
On Fri, 31 Mar 2017 14:07:09 +0200
Andrea Mauri wrote:
> I didn't understand how TBits.NotBits works.
AFAIK a.NotBits(b) means (a and not b):
a b result
0 0 0
0 1 0
1 0 1
1 1 0
Mattias
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://
any answer?
I asked in the wrong place?
where should I ask?
Il 31/03/2017 14:10, Andrea Mauri ha scritto:
one more thing.
there is a method like clearall to set all bits to 1?
clearall is much more faster then a simple iteration along all bits
Il 31/03/2017 14:07, Andrea Mauri ha scritto:
I di
one last thing, using TBits it is possible to SetIndex in order to start
from a predefined index when using FindNextBit and FindPrevBit
Anyway it is possible to set the State only using FindFirstBit, so I
cannot use FindNextBit only using SetIndex but I have to call also
FindFirstBit.
Is it pos
one more thing.
there is a method like clearall to set all bits to 1?
clearall is much more faster then a simple iteration along all bits
Il 31/03/2017 14:07, Andrea Mauri ha scritto:
I didn't understand how TBits.NotBits works.
Consider the following code:
b:= TBits.Create(NRECORDS);
b.No
I didn't understand how TBits.NotBits works.
Consider the following code:
b:= TBits.Create(NRECORDS);
b.NotBits(b);
or more clear:
b:= TBits.Create(NRECORDS);
b.Clearall;
b.NotBits(b);
I supposed that all bits of b will be 1. What I obtain is that all bits
are 0.
fpc 3.0.0 win64