Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 7, 2025

The documentation for BitConverter.ToUInt128(byte[] value, int startIndex) contained an inconsistency:

  • Summary: incorrectly stated "four bytes"
  • Returns: correctly stated "sixteen bytes"

Since UInt128 is a 128-bit integer, it requires 16 bytes (128 ÷ 8 = 16), not 4 bytes. This fix updates the summary to correctly state "sixteen bytes" to match the returns documentation and the actual implementation.

Before:

/// <summary>
/// Returns a 128-bit unsigned integer converted from four bytes at a specified position in a byte array.
/// </summary>

After:

/// <summary>
/// Returns a 128-bit unsigned integer converted from sixteen bytes at a specified position in a byte array.
/// </summary>

The change aligns with:

  • The actual implementation (UInt128.Size = 16)
  • The returns documentation (which correctly states "sixteen bytes")
  • The consistent documentation in ToInt128 method

Fixes #117364.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@skyoxZ
Copy link
Contributor

skyoxZ commented Jul 7, 2025

There are more four bytes comments problems in BitConverter.cs. Can @copilot fix them all?

@stephentoub
Copy link
Member

There are more four bytes comments problems in BitConverter.cs. Can @copilot fix them all?

Yes, @copilot, please find and fix all such issues.

…xteen bytes"

Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Copilot AI changed the title [WIP] Incorrect documentation for BitConverter.ToUInt128 Fix BitConverter.ToUInt128 documentation inconsistency Jul 7, 2025
Copilot AI requested a review from stephentoub July 7, 2025 13:20
…cies

Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 7, 2025

There are more four bytes comments problems in BitConverter.cs. Can @copilot fix them all?

Yes, @copilot, please find and fix all such issues.

Fixed all "four bytes" documentation inconsistencies in BitConverter.cs. Updated ToUInt64 and ToDouble documentation to correctly state "eight bytes" (64-bit types). The previously fixed ToUInt128 and all remaining "four bytes" references for 32-bit types are now consistent. Changes committed in 6c874d8.

@stephentoub stephentoub marked this pull request as ready for review July 7, 2025 13:57
@stephentoub stephentoub enabled auto-merge (squash) July 7, 2025 13:57
@github-actions github-actions bot locked and limited conversation to collaborators Aug 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect documentation for BitConverter.ToUInt128

5 participants