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

◆ Multiply() [2/4]

static unsafe void System.Number.BigInteger.Multiply ( ref BigInteger lhs,
uint value,
out BigInteger result )
inlinestatic

Definition at line 310 of file Number.cs.

311 {
312 if (lhs._length <= 1)
313 {
314 SetUInt64(out result, (ulong)lhs.ToUInt32() * (ulong)value);
315 return;
316 }
317 switch (value)
318 {
319 case 0u:
320 SetZero(out result);
321 return;
322 case 1u:
323 SetValue(out result, ref lhs);
324 return;
325 }
326 int length = lhs._length;
327 int i = 0;
328 uint num = 0u;
329 for (; i < length; i++)
330 {
331 ulong num2 = (ulong)((long)lhs._blocks[i] * (long)value + num);
332 result._blocks[i] = (uint)num2;
333 num = (uint)(num2 >> 32);
334 }
335 if (num != 0)
336 {
337 result._blocks[i] = num;
338 result._length = length + 1;
339 }
340 else
341 {
342 result._length = length;
343 }
344 }
static void SetZero(out BigInteger result)
Definition Number.cs:620
static unsafe void SetUInt64(out BigInteger result, ulong value)
Definition Number.cs:603
static unsafe void SetValue(out BigInteger result, ref BigInteger value)
Definition Number.cs:615

References System.length, System.Number.BigInteger.SetUInt64(), System.Number.BigInteger.SetValue(), System.Number.BigInteger.SetZero(), and System.value.

Referenced by System.Number.Dragon4().