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

◆ LeadingZeros()

static int System.Numerics.BigIntegerCalculator.LeadingZeros ( uint value)
inlinestaticprivate

Definition at line 648 of file BigIntegerCalculator.cs.

649 {
650 if (value == 0)
651 {
652 return 32;
653 }
654 int num = 0;
655 if ((value & 0xFFFF0000u) == 0)
656 {
657 num += 16;
658 value <<= 16;
659 }
660 if ((value & 0xFF000000u) == 0)
661 {
662 num += 8;
663 value <<= 8;
664 }
665 if ((value & 0xF0000000u) == 0)
666 {
667 num += 4;
668 value <<= 4;
669 }
670 if ((value & 0xC0000000u) == 0)
671 {
672 num += 2;
673 value <<= 2;
674 }
675 if ((value & 0x80000000u) == 0)
676 {
677 num++;
678 }
679 return num;
680 }

References System.value.

Referenced by System.Numerics.BigIntegerCalculator.Divide(), and System.Numerics.BigIntegerCalculator.ExtractDigits().