Math.ILogB incorrectly uses TZCNT instead of LZCNT for subnormal values:
|
return double.MinExponent - (BitOperations.TrailingZeroCount(x.TrailingSignificand) - double.BiasedExponentLength); |
Math.ILogB(1e-308) returns -1024 on .NET 8, and -1012 on .NET 9. The correct result is -1024.
Math.ILogBincorrectly uses TZCNT instead of LZCNT for subnormal values:runtime/src/libraries/System.Private.CoreLib/src/System/Math.cs
Line 898 in 8234fe3
Math.ILogB(1e-308)returns -1024 on .NET 8, and -1012 on .NET 9. The correct result is -1024.