Skip to content

Add hex float formatting and basic tests

30afcdc
Select commit
Loading
Failed to load commit list.
Open

Add hexadecimal float/double parsing and formatting support (IEEE 754:2008) #120637

Add hex float formatting and basic tests
30afcdc
Select commit
Loading
Failed to load commit list.
Build Analysis / Build Analysis failed Oct 11, 2025 in 0s

.NET Result Analysis

Details

Tip

To unconditionally bypass the build analysis check (turn it green), you can use the escape mechanism feature. The completion time may vary, potentially taking several minutes, depending on the build analysis workload at the moment.

Build Failures

runtime / Build / linux-arm Debug AllSubsets_CoreCLR_ReleaseRuntimeLibs / Build product

[ 🚧 Report infrastructure issue] [ 📄 Report repository issue]
    ❌src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs(639,115): error IDE0060: Remove unused parameter 'format' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0060)
    ❌src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs(639,140): error IDE0060: Remove unused parameter 'info' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0060)
    ❌src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs(639,96): error IDE0060: Remove unused parameter 'precision' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0060)

runtime / Build / linux_musl-arm Debug AllSubsets_CoreCLR_ReleaseRuntimeLibs / Build product

[ 🚧 Report infrastructure issue] [ 📄 Report repository issue]
    ❌src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs(639,140): error IDE0060: Remove unused parameter 'info' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0060)
    ❌src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs(639,96): error IDE0060: Remove unused parameter 'precision' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0060)
    ❌src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs(639,115): error IDE0060: Remove unused parameter 'format' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0060)

runtime / Build / linux_musl-arm64 Debug AllSubsets_CoreCLR_ReleaseRuntimeLibs / Build product

[ 🚧 Report infrastructure issue] [ 📄 Report repository issue]
    ❌src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs(639,115): error IDE0060: Remove unused parameter 'format' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0060)
    ❌src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs(639,140): error IDE0060: Remove unused parameter 'info' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0060)
    ❌src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs(639,96): error IDE0060: Remove unused parameter 'precision' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0060)

76 other jobs are failing and were not displayed due to space limitations.
Builds with failures: [runtime] [runtime-dev-innerloop] [dotnet-linker-tests]

Test Failures (21 tests failed)

🔹 [All failing tests from runtime]

    ⚠️ 16 failing tests not displayed for this pipeline due to space limitations

    System.Tests.DoubleTests_GenericMath.ParseValidSpanTest [Console] [Details] [Artifacts] [0.00% failure rate]
    [ 🚧 Report test infrastructure issue] [ 📄 Report test repository issue]

    Failing Configurations (3)

    Data Driven SubResults
      System.Tests.DoubleTests_GenericMath.ParseValidSpanTest(value: \"0x1.0p0\", offset: 0, count: 7, style: HexFloat, provider: NumberFormatInfo { }, expected: 1)
      Exception Message
      Assert.Equal() Failure: Values differ
      Expected: 1
      Actual:   1.0819471997658424E+273
      Stack Trace
         at System.Tests.DoubleTests_GenericMath.ParseValidSpanTest(String value, Int32 offset, Int32 count, NumberStyles style, IFormatProvider provider, Double expected) + 0x2f0
         at System.Runtime!<BaseAddress>+0x2918070
         at System.Reflection.DynamicInvokeInfo.InvokeWithManyArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0x12c
      System.Tests.DoubleTests_GenericMath.ParseValidSpanTest(value: \"0x1.8p0\", offset: 0, count: 7, style: HexFloat, provider: NumberFormatInfo { }, expected: 1.5)
      Exception Message
      Assert.Equal() Failure: Values differ
      Expected: 1.5
      Actual:   2.1638943995316848E+273
      Stack Trace
         at System.Tests.DoubleTests_GenericMath.ParseValidSpanTest(String value, Int32 offset, Int32 count, NumberStyles style, IFormatProvider provider, Double expected) + 0x2f0
         at System.Runtime!<BaseAddress>+0x2918070
         at System.Reflection.DynamicInvokeInfo.InvokeWithManyArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0x12c
      System.Tests.DoubleTests_GenericMath.ParseValidSpanTest(value: \"0x1.0p1\", offset: 0, count: 7, style: HexFloat, provider: NumberFormatInfo { }, expected: 2)
      Exception Message
      Assert.Equal() Failure: Values differ
      Expected: 2
      Actual:   4.3277887990633697E+273
      Stack Trace
         at System.Tests.DoubleTests_GenericMath.ParseValidSpanTest(String value, Int32 offset, Int32 count, NumberStyles style, IFormatProvider provider, Double expected) + 0x2f0
         at System.Runtime!<BaseAddress>+0x2918070
         at System.Reflection.DynamicInvokeInfo.InvokeWithManyArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0x12c
    System.Tests.DoubleTests_GenericMath.ParseValidStringTest [Console] [Details] [Artifacts] [0.00% failure rate]
    [ 🚧 Report test infrastructure issue] [ 📄 Report test repository issue]

    Failing Configurations (3)

    Data Driven SubResults
      System.Tests.DoubleTests_GenericMath.ParseValidStringTest(value: \"0x1.0p0\", style: HexFloat, provider: NumberFormatInfo { }, expected: 1)
      Exception Message
      Assert.Equal() Failure: Values differ
      Expected: 1
      Actual:   1.0819471997658424E+273
      Stack Trace
         at System.Tests.DoubleTests_GenericMath.ParseValidStringTest(String value, NumberStyles style, IFormatProvider provider, Double expected) + 0x274
         at System.Runtime!<BaseAddress>+0x2907210
         at System.Reflection.DynamicInvokeInfo.InvokeWithFewArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0x84
      System.Tests.DoubleTests_GenericMath.ParseValidStringTest(value: \"0x1.8p0\", style: HexFloat, provider: NumberFormatInfo { }, expected: 1.5)
      Exception Message
      Assert.Equal() Failure: Values differ
      Expected: 1.5
      Actual:   2.1638943995316848E+273
      Stack Trace
         at System.Tests.DoubleTests_GenericMath.ParseValidStringTest(String value, NumberStyles style, IFormatProvider provider, Double expected) + 0x274
         at System.Runtime!<BaseAddress>+0x2907210
         at System.Reflection.DynamicInvokeInfo.InvokeWithFewArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0x84
      System.Tests.DoubleTests_GenericMath.ParseValidStringTest(value: \"0x1.0p1\", style: HexFloat, provider: NumberFormatInfo { }, expected: 2)
      Exception Message
      Assert.Equal() Failure: Values differ
      Expected: 2
      Actual:   4.3277887990633697E+273
      Stack Trace
         at System.Tests.DoubleTests_GenericMath.ParseValidStringTest(String value, NumberStyles style, IFormatProvider provider, Double expected) + 0x274
         at System.Runtime!<BaseAddress>+0x2907210
         at System.Reflection.DynamicInvokeInfo.InvokeWithFewArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0x84
    System.Tests.DoubleTests.Parse [Console] [Details] [Artifacts] [0.00% failure rate]
    [ 🚧 Report test infrastructure issue] [ 📄 Report test repository issue]

    Failing Configurations (3)

    Data Driven SubResults
      System.Tests.DoubleTests.Parse(value: \"0x1.0p0\", style: HexFloat, provider: NumberFormatInfo { }, expected: 1)
      Exception Message
      Assert.Equal() Failure: Values differ
      Expected: 1
      Actual:   1.0819471997658424E+273
      Stack Trace
         at System.Tests.DoubleTests.Parse(String value, NumberStyles style, IFormatProvider provider, Double expected) + 0x274
         at System.Runtime!<BaseAddress>+0x2907210
         at System.Reflection.DynamicInvokeInfo.InvokeWithFewArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0x84
      System.Tests.DoubleTests.Parse(value: \"0x1.8p0\", style: HexFloat, provider: NumberFormatInfo { }, expected: 1.5)
      Exception Message
      Assert.Equal() Failure: Values differ
      Expected: 1.5
      Actual:   2.1638943995316848E+273
      Stack Trace
         at System.Tests.DoubleTests.Parse(String value, NumberStyles style, IFormatProvider provider, Double expected) + 0x274
         at System.Runtime!<BaseAddress>+0x2907210
         at System.Reflection.DynamicInvokeInfo.InvokeWithFewArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0x84
      System.Tests.DoubleTests.Parse(value: \"0x1.0p1\", style: HexFloat, provider: NumberFormatInfo { }, expected: 2)
      Exception Message
      Assert.Equal() Failure: Values differ
      Expected: 2
      Actual:   4.3277887990633697E+273
      Stack Trace
         at System.Tests.DoubleTests.Parse(String value, NumberStyles style, IFormatProvider provider, Double expected) + 0x274
         at System.Runtime!<BaseAddress>+0x2907210
         at System.Reflection.DynamicInvokeInfo.InvokeWithFewArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0x84
    System.Tests.DoubleTests.Parse_Span_Valid [Console] [Details] [Artifacts] [0.00% failure rate]
    [ 🚧 Report test infrastructure issue] [ 📄 Report test repository issue]

    Failing Configurations (3)

    Data Driven SubResults
      System.Tests.DoubleTests.Parse_Span_Valid(value: \"0x1.0p0\", offset: 0, count: 7, style: HexFloat, provider: NumberFormatInfo { }, expected: 1)
      Exception Message
      Assert.Equal() Failure: Values differ
      Expected: 1
      Actual:   1.0819471997658424E+273
      Stack Trace
         at System.Tests.DoubleTests.Parse_Span_Valid(String value, Int32 offset, Int32 count, NumberStyles style, IFormatProvider provider, Double expected) + 0x2f0
         at System.Runtime!<BaseAddress>+0x2918070
         at System.Reflection.DynamicInvokeInfo.InvokeWithManyArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0x12c
      System.Tests.DoubleTests.Parse_Span_Valid(value: \"0x1.8p0\", offset: 0, count: 7, style: HexFloat, provider: NumberFormatInfo { }, expected: 1.5)
      Exception Message
      Assert.Equal() Failure: Values differ
      Expected: 1.5
      Actual:   2.1638943995316848E+273
      Stack Trace
         at System.Tests.DoubleTests.Parse_Span_Valid(String value, Int32 offset, Int32 count, NumberStyles style, IFormatProvider provider, Double expected) + 0x2f0
         at System.Runtime!<BaseAddress>+0x2918070
         at System.Reflection.DynamicInvokeInfo.InvokeWithManyArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0x12c
      System.Tests.DoubleTests.Parse_Span_Valid(value: \"0x1.0p1\", offset: 0, count: 7, style: HexFloat, provider: NumberFormatInfo { }, expected: 2)
      Exception Message
      Assert.Equal() Failure: Values differ
      Expected: 2
      Actual:   4.3277887990633697E+273
      Stack Trace
         at System.Tests.DoubleTests.Parse_Span_Valid(String value, Int32 offset, Int32 count, NumberStyles style, IFormatProvider provider, Double expected) + 0x2f0
         at System.Runtime!<BaseAddress>+0x2918070
         at System.Reflection.DynamicInvokeInfo.InvokeWithManyArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0x12c
    System.Tests.DoubleTests.Parse_Utf8Span_Valid [Console] [Details] [Artifacts] [0.00% failure rate]
    [ 🚧 Report test infrastructure issue] [ 📄 Report test repository issue]

    Failing Configurations (3)

    Data Driven SubResults
      System.Tests.DoubleTests.Parse_Utf8Span_Valid(value: \"0x1.0p0\", offset: 0, count: 7, style: HexFloat, provider: NumberFormatInfo { }, expected: 1)
      Exception Message
      System.ArgumentException : With the AllowHexSpecifier or AllowBinarySpecifier bit set in the enum bit field, the only other valid bits that can be combined into the enum value must be AllowLeadingWhite and AllowTrailingWhite. (Parameter 'style')
      Stack Trace
         at System.Globalization.NumberFormatInfo.<ValidateParseStyleInteger>g__ThrowInvalid|165_0(NumberStyles) + 0x4c
         at System.Tests.DoubleTests.Parse_Utf8Span_Valid(String value, Int32 offset, Int32 count, NumberStyles style, IFormatProvider provider, Double expected) + 0x30c
         at System.Runtime!<BaseAddress>+0x2918070
         at System.Reflection.DynamicInvokeInfo.InvokeWithManyArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0x12c
      System.Tests.DoubleTests.Parse_Utf8Span_Valid(value: \"0x1.8p0\", offset: 0, count: 7, style: HexFloat, provider: NumberFormatInfo { }, expected: 1.5)
      Exception Message
      System.ArgumentException : With the AllowHexSpecifier or AllowBinarySpecifier bit set in the enum bit field, the only other valid bits that can be combined into the enum value must be AllowLeadingWhite and AllowTrailingWhite. (Parameter 'style')
      Stack Trace
         at System.Globalization.NumberFormatInfo.<ValidateParseStyleInteger>g__ThrowInvalid|165_0(NumberStyles) + 0x4c
         at System.Tests.DoubleTests.Parse_Utf8Span_Valid(String value, Int32 offset, Int32 count, NumberStyles style, IFormatProvider provider, Double expected) + 0x30c
         at System.Runtime!<BaseAddress>+0x2918070
         at System.Reflection.DynamicInvokeInfo.InvokeWithManyArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0x12c
      System.Tests.DoubleTests.Parse_Utf8Span_Valid(value: \"0x1.0p1\", offset: 0, count: 7, style: HexFloat, provider: NumberFormatInfo { }, expected: 2)
      Exception Message
      System.ArgumentException : With the AllowHexSpecifier or AllowBinarySpecifier bit set in the enum bit field, the only other valid bits that can be combined into the enum value must be AllowLeadingWhite and AllowTrailingWhite. (Parameter 'style')
      Stack Trace
         at System.Globalization.NumberFormatInfo.<ValidateParseStyleInteger>g__ThrowInvalid|165_0(NumberStyles) + 0x4c
         at System.Tests.DoubleTests.Parse_Utf8Span_Valid(String value, Int32 offset, Int32 count, NumberStyles style, IFormatProvider provider, Double expected) + 0x30c
         at System.Runtime!<BaseAddress>+0x2918070
         at System.Reflection.DynamicInvokeInfo.InvokeWithManyArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0x12c

Was this helpful? Yes No