diff --git a/src/System.Private.CoreLib/shared/System/Number.BigInteger.cs b/src/System.Private.CoreLib/shared/System/Number.BigInteger.cs index 607b450686e1..07c4112da9b1 100644 --- a/src/System.Private.CoreLib/shared/System/Number.BigInteger.cs +++ b/src/System.Private.CoreLib/shared/System/Number.BigInteger.cs @@ -460,14 +460,7 @@ public static uint CountSignificantBits(uint value) public static uint CountSignificantBits(ulong value) { - uint upper = (uint)(value >> 32); - - if (upper != 0) - { - return 32 + CountSignificantBits(upper); - } - - return CountSignificantBits((uint)value); + return 64 - (uint)BitOps.LeadingZeroCount(value); } public static uint CountSignificantBits(ref BigInteger value)