Forum > General

TBits constructor

(1/3) > >>

Blaazen:
Is this a bug or an intention?

Class TBits, file classesh.inc, line 403:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---constructor Create(TheSize : longint = 0); virtual;
I.e. whole class is carefully implemented with SizeInt (here it's Int64) and constructor is the only place with LongInt.

It can be easily workarounded:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var aBits: TBits;    N: Longword;begin  N:=4200000000;  aBits:=TBits.Create(0);  aBits.Size:=N;IMO it is needless limit.

Bart:
You need to have 2^63-1 bits in TBits?
(Yes, I understand it's inconsistent).

Bart

Zvoni:
additionally, what escapes me is the usage of a signed Integer for that.

I'm trying to wrap my mind around the question, in which scenario i could use a negative Size for something like this....

TRon:

--- Quote from: Zvoni on February 07, 2023, 03:02:31 pm ---I'm trying to wrap my mind around the question, in which scenario i could use a negative Size for something like this....

--- End quote ---
jump, jump, jump, raises hand, pick me !, pick me ! I know the answer to that question: NEVER !  :)

winni:

--- Quote from: Bart on February 07, 2023, 02:38:56 pm ---You need to have 2^63-1 bits in TBits?
(Yes, I understand it's inconsistent).

Bart

--- End quote ---

Hi!

For 2^64 bits you need

2.097.152 TeraByte

as RAM.

We continue the discussion about signed/unsigned parameter, when this machine is available.

Winni

Navigation

[0] Message Index

[#] Next page

Go to full version