29 writes to _bits
System.Numerics (29)
System\Numerics\BigInteger.cs (29)
398
_bits
= null;
409
_bits
= null;
414
_bits
= new uint[1];
429
_bits
= null;
448
_bits
= new uint[2];
460
_bits
= null;
465
_bits
= new uint[2];
481
_bits
= null;
495
_bits
= null;
518
_bits
= null;
521
_bits
= new UInt32[size];
552
_bits
= null;
569
_bits
= null;
577
_bits
= new uint[1];
635
_bits
= null;
640
_bits
= new uint[len];
645
_bits
= val;
651
_bits
= val;
660
_bits
= rgu;
692
_bits
= null;
700
_bits
= new uint[len];
733
_bits
= new uint[1];
743
_bits
= null;
753
_bits
= new uint[dwordCount];
759
_bits
= value;
783
_bits
= null;
790
_bits
= new uint[len];
796
_bits
= value;
1779
_bits
= new uint[cu + 2];
118 references to _bits
System.Numerics (118)
System\Numerics\BigInteger.cs (115)
65
if (
_bits
!= null)
68
Contract.Assert(Length(
_bits
) > 0 /*, "_bits must contain at least 1 element or be null"*/);
69
if (Length(
_bits
) == 1)
70
Contract.Assert(
_bits
[0] >= kuMaskHighBit /*, "Wasted space _bits[0] could have been packed into _sign"*/);
101
if (
_bits
== null)
106
int iu = Length(
_bits
) - 1;
107
if ((
_bits
[iu] & (
_bits
[iu] - 1)) != 0)
111
if (
_bits
[iu] != 0)
120
public bool IsOne { get { AssertValid(); return _sign == 1 &&
_bits
== null; } }
122
public bool IsEven { get { AssertValid(); return
_bits
== null ? (_sign & 1) == 0 : (
_bits
[0] & 1) == 0; } }
148
if (
_bits
== null)
151
for (int iv = Length(
_bits
); --iv >= 0; )
152
hash = NumericsHelpers.CombineHash(hash, (int)
_bits
[iv]);
160
if (
_bits
== null)
164
if ((_sign ^ other) < 0 || (cu = Length(
_bits
)) > 2)
169
return
_bits
[0] == uu;
171
return NumericsHelpers.MakeUlong(
_bits
[1],
_bits
[0]) == uu;
181
if (
_bits
== null)
184
int cu = Length(
_bits
);
188
return
_bits
[0] == other;
189
return NumericsHelpers.MakeUlong(
_bits
[1],
_bits
[0]) == other;
199
if (
_bits
== other.
_bits
)
203
if (
_bits
== null || other.
_bits
== null)
205
int cu = Length(
_bits
);
206
if (cu != Length(other.
_bits
))
208
int cuDiff = GetDiffLength(
_bits
, other.
_bits
, cu);
216
if (
_bits
== null)
219
if ((_sign ^ other) < 0 || (cu = Length(
_bits
)) > 2)
222
ulong uuTmp = cu == 2 ? NumericsHelpers.MakeUlong(
_bits
[1],
_bits
[0]) :
_bits
[0];
233
if (
_bits
== null)
235
int cu = Length(
_bits
);
238
ulong uuTmp = cu == 2 ? NumericsHelpers.MakeUlong(
_bits
[1],
_bits
[0]) :
_bits
[0];
254
if (
_bits
== null)
256
if (other.
_bits
== null)
261
if (other.
_bits
== null || (cuThis = Length(
_bits
)) > (cuOther = Length(other.
_bits
)))
266
int cuDiff = GetDiffLength(
_bits
, other.
_bits
, cuThis);
269
return
_bits
[cuDiff - 1] < other.
_bits
[cuDiff - 1] ? -_sign : _sign;
286
if (
_bits
== null && _sign == 0)
295
if (
_bits
== null) {
300
dwords = (uint[])
_bits
.Clone();
304
dwords =
_bits
;
338
if (
_bits
== null && _sign == 0)
344
if (
_bits
== null) {
349
dwords = (uint[])
_bits
.Clone();
353
dwords =
_bits
;
415
_bits
[0] = value;
449
_bits
[0] = (uint)x;
450
_bits
[1] = (uint)(x >> kcbitUint);
466
_bits
[0] = (uint)value;
467
_bits
[1] = (uint)(value >> kcbitUint);
522
_bits
[0] = (UInt32)bits[0];
524
_bits
[1] = (UInt32)bits[1];
526
_bits
[2] = (UInt32)bits[2];
578
_bits
[0] = (uint)_sign;
641
Array.Copy(val,
_bits
, len);
701
Array.Copy(value,
_bits
, len);
734
_bits
[0] = value[0];
754
Array.Copy(value,
_bits
, dwordCount);
791
Array.Copy(value,
_bits
, len);
907
if (value.
_bits
== null)
913
int uintLength = Length(value.
_bits
);
914
int topbits = BitLengthOfUInt(value.
_bits
[uintLength - 1]);
922
if ((value.
_bits
[index] & indbit) != 0)
1029
if (exponent.
_bits
== null)
1035
int len = Length(exponent.
_bits
);
1038
uint exp = exponent.
_bits
[i];
1041
ModPowInner(exponent.
_bits
[len - 1], ref regRes, ref regVal, ref regMod, ref regTmp);
1059
if (value.
_bits
== null)
1216
if (value.
_bits
== null) {
1219
else if (Length(value.
_bits
) > 1) { // more than 32 bits
1223
return checked((int)value.
_bits
[0]);
1226
if (value.
_bits
[0] > kuMaskHighBit) { // value > Int32.MinValue
1229
return unchecked(-(int)value.
_bits
[0]);
1237
if (value.
_bits
== null) {
1240
else if (Length(value.
_bits
) > 1 || value._sign < 0) {
1244
return value.
_bits
[0];
1251
if (value.
_bits
== null) {
1255
int len = Length(value.
_bits
);
1262
uu = NumericsHelpers.MakeUlong(value.
_bits
[1], value.
_bits
[0]);
1265
uu = (ulong)value.
_bits
[0];
1280
if (value.
_bits
== null) {
1284
int len = Length(value.
_bits
);
1290
return NumericsHelpers.MakeUlong(value.
_bits
[1], value.
_bits
[0]);
1293
return value.
_bits
[0];
1305
if (value.
_bits
== null)
1319
if (value.
_bits
== null)
1322
int length = Length(value.
_bits
);
1326
if (length > 2) hi = (Int32)value.
_bits
[2];
1327
if (length > 1) mi = (Int32)value.
_bits
[1];
1328
if (length > 0) lo = (Int32)value.
_bits
[0];
1780
_bits
[cu + 1] = (uint)(man >> (cbit + kcbitUint));
1781
_bits
[cu] = (uint)(man >> cbit);
1783
_bits
[cu - 1] = (uint)man << (kcbitUint - cbit);
1803
internal uint[] _Bits { get { return
_bits
; } }
1831
if (x.
_bits
== null) {
1840
xd = x.
_bits
;
1842
xl = (x.
_bits
== null ? 1 : x.
_bits
.Length);
System\Numerics\BigNumber.cs (3)
527
if (value.
_bits
== null) {
542
int cuSrc = BigInteger.Length(value.
_bits
);
552
uint uCarry = value.
_bits
[iuSrc];