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

◆ Divide() [4/5]

static unsafe uint[] System.Numerics.BigIntegerCalculator.Divide ( uint[] left,
uint[] right )
inlinestatic

Definition at line 498 of file BigIntegerCalculator.cs.

499 {
500 Span<uint> destination = default(Span<uint>);
501 Span<uint> span;
502 if (left.Length <= 64)
503 {
504 span = stackalloc uint[64];
505 destination = span.Slice(0, left.Length);
506 span = left.AsSpan();
507 span.CopyTo(destination);
508 }
509 else
510 {
511 span = left.AsSpan();
512 destination = span.ToArray();
513 }
514 uint[] array = new uint[left.Length - right.Length + 1];
515 fixed (uint* left2 = &destination[0])
516 {
517 fixed (uint* right2 = &right[0])
518 {
519 fixed (uint* bits = &array[0])
520 {
521 Divide(left2, destination.Length, right2, right.Length, bits, array.Length);
522 }
523 }
524 }
525 return array;
526 }

References System.array, System.Span< T >.CopyTo(), System.destination, System.Divide, System.Span< T >.Slice(), and System.Span< T >.ToArray().