-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update System.Numerics.Vector<T> documents #3334
Conversation
Looking at some other issues, it's not clear whether the constructors throwing |
https://github.com/dotnet/corefx/issues/25344#issuecomment-541303592
|
What should we do for these case, should we use different word instead of 'primitive' here as well? |
@tannergooding can you help answer @Gnbrkm41 's question? |
I think use of the word "primitive" is fine, we just need to ensure that its meaning and/or constraints is defined somewhere |
* Emphasise that this type is not appropriate for general purpose vector operations * Update ctor remarks so that only primitive numeric types are allowed * Update ctor remarks so that only the first `Vector<T>.Count` elements are added to the vector (for Span/Array overloads) * Add information about exception that can be thrown when array.Length < Vector<T>.Count Related: https://github.com/dotnet/corefx/issues/23448
* Pull the type constraint to the top of the ctor docs since it's shared throughout, list out the types for future-proofing * Update param descriptions for array/spans to be explicit about the remainders Part of dotnet-api-docs/#3334 Co-Authored-By: Tanner Gooding <tagoo@outlook.com>
* Reference the type instead of just writing it out
I've added some explanations on what we mean when we say "primitive", though I don't think it's a problem anymore given we only have 3 usage of the word "primitive" now. |
Scratch what I said above. I was really thinking of Vector2. Does Vector2 fall into this same category of "you shouldn't really use this for everyday normal programming?" |
I don't think it does. Vector2/3/4 are types that represent the mathematical definition of Vector and definitely can be used in places where you need them, like when you represent points on a 2D space 🙂 It's just that Vector can cause confusion that it exists for the same reason (representing mathematical vector) when it's not due to its name and it being in the same |
While I did end up changing the singular to plural with the last commit, I'm actually not entirely sure which one is correct; As a non-native English speaker this is one of those things that I honestly never thought much about, but this made me wonder which is supposed to be used. Asking around a few people the result I got was to use singular, which contradicts with the suggestion I've got here (which obviously does not help). It would be nice if we could get more opinion or a definitive answer on this... Apart from that, I probably should additionally state that the |
Thank you for working on this, @Gnbrkm41 . |
Summary
Vector<T>.Count
elements are added to the vector (for Span/Array overloads)array.Length
<Vector<T>.Count
Fixes https://github.com/dotnet/corefx/issues/23448
cc @tannergooding (Issue author, area owner)