dotnet / dotnet/dotnet-api-docs
Missing type param in System.Numerics.Vector<T>(ReadOnlySpan<byte>) constructor documentation leads to confusion.
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
---
**Issue moved from MicrosoftDocs/feedback#3204**
- Please respond to @gunjambi.
---
_From @gunjambi on Tuesday, October 20, 2020 6:54:40 PM_
On Docs page for `System.Numerics.Vector` constructor `Vector(ReadOnlySpan values)`, the parameter `values` is documented as follows:
`A read-only span of bytes that contains the values to add to the vector. The span must contain at least Count elements and only the first Count elements are used.`, where the `Count` is a hyperlink to the `Vector::Count` property.
This is misleading as the reader will assume the `Count` referes to `Vector::Count`. Instead, the documentation should explicitly refer to `Vector::Count` as documented in the CoreLib source, i.e. the byte size of the hardware register.
(`Vector::Count` ~= how many `T`s can fit in one HW vector register)
(`Vector::Count` ~= how many bytes can fit in one HW vector register)
Docs page:
[https://docs.microsoft.com/en-us/dotnet/api/system.numerics.vector-1.-ctor?view=netcore-3.1#System_Numerics_Vector_1__ctor_System_ReadOnlySpan_System_Byte__](https://docs.microsoft.com/en-us/dotnet/api/system.numerics.vector-1.-ctor?view=netcore-3.1#System_Numerics_Vector_1__ctor_System_ReadOnlySpan_System_Byte__)
CoreLib source:
https://github.com/dotnet/runtime/blob/e85caf1/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs#L120-L123
Contributor guide
Assessment
This issue has not been assessed yet.