Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Add()

void System.Xml.Xsl.XPathConvert.BigInteger.Add ( BigInteger bi)
inline

Definition at line 1186 of file XPathConvert.cs.

1187 {
1188 int length;
1189 int length2;
1190 if ((length = _length) < (length2 = bi._length))
1191 {
1192 length = bi._length;
1193 length2 = _length;
1194 Ensure(length + 1);
1195 }
1196 uint num = 0u;
1197 int i;
1198 for (i = 0; i < length2; i++)
1199 {
1200 if (num != 0)
1201 {
1202 num = AddU(ref _digits[i], num);
1203 }
1204 num += AddU(ref _digits[i], bi._digits[i]);
1205 }
1206 if (_length < bi._length)
1207 {
1208 for (; i < length; i++)
1209 {
1210 _digits[i] = bi._digits[i];
1211 if (num != 0)
1212 {
1213 num = AddU(ref _digits[i], num);
1214 }
1215 }
1216 _length = length;
1217 }
1218 else
1219 {
1220 while (num != 0 && i < length)
1221 {
1222 num = AddU(ref _digits[i], num);
1223 i++;
1224 }
1225 }
1226 if (num != 0)
1227 {
1228 Ensure(_length + 1);
1229 _digits[_length++] = num;
1230 }
1231 }
static uint AddU(ref uint u1, uint u2)

References System.Xml.Xsl.XPathConvert.BigInteger._digits, System.Xml.Xsl.XPathConvert.BigInteger._length, System.Xml.Xsl.XPathConvert.AddU(), System.Xml.Dictionary, System.Xml.Xsl.XPathConvert.BigInteger.Ensure(), System.length, and System.length2.