Fixed BigInt string initializers
This commit is contained in:
parent
eee05a9646
commit
1caee9ae6e
|
@ -390,7 +390,12 @@ var
|
|||
charBlockSize, offset, i, j, k, remainder: Integer;
|
||||
d: Cardinal;
|
||||
begin
|
||||
charBlockSize := 64 div AFromBase;
|
||||
// 2 ^ (32 / charBlockSize) = AFromBase
|
||||
case AFromBase of
|
||||
2: charBlockSize := 32;
|
||||
16: charBlockSize := 8;
|
||||
end;
|
||||
|
||||
if AValue[1] = '-' then
|
||||
begin
|
||||
offset := 2;
|
||||
|
@ -402,7 +407,7 @@ begin
|
|||
end;
|
||||
|
||||
// Calculates the first (most significant) digit d of the result.
|
||||
DivMod(AValue.Length - offset, charBlockSize, i, remainder);
|
||||
DivMod(AValue.Length - offset + 1, charBlockSize, i, remainder);
|
||||
k := offset;
|
||||
d := 0;
|
||||
// Checks the first block of chars that is not a full block.
|
||||
|
|
Loading…
Reference in New Issue