Unconstraining Scalar ; adding BigInteger and Complex#633
Unconstraining Scalar ; adding BigInteger and Complex#633HurricanKai merged 13 commits intodotnet:mainfrom
Conversation
|
I haven't worked on Scalar.MathFPort and MissingMethods for now |
HurricanKai
left a comment
There was a problem hiding this comment.
Initial review. I need to inform myself what ie Reciprocal of a Complex even means.
| else if (typeof(T) == typeof(decimal)) | ||
| { | ||
| Epsilon = default; | ||
| Epsilon = default!; |
There was a problem hiding this comment.
This doesn't feel right, are you sure?
There was a problem hiding this comment.
Yeah, I know. But where does the nullability analysis warning come from? Is it not new?
There was a problem hiding this comment.
From T unconstrained. It was unmanaged, so nobody cared about it. Now it's potentially a ref type
|
Oopsi, I forgot to change the docs |
|
Okay so there was no docs to change 😆 🦆🦆🦆 |
HurricanKai
left a comment
There was a problem hiding this comment.
Other then that one discussion this seems good, am I mistaken or does this only include Reciprocal and Abs? Happy to have those of course, I would just not return true in IsSupported for those types.
|
Uh, no, there's also BaseOps changed :) @HurricanKai |
|
It's just not expanded by GH's Files Changed tab |
|
Oh, why is that, where can I view those changes then? |
|
@HurricanKai easy to miss :) |
| /// <returns><code>true</code> if the value is normal; <code>false</code> otherwise.</returns> | ||
| [MethodImpl(MaxOpt)] | ||
| public static bool IsNormal<T>(T f) where T : unmanaged | ||
| public static bool IsNormal<T>(T f) |
There was a problem hiding this comment.
I'm surprised a Complex can't be normal, that seems odd. I know S.Numerics doesn't have it either. Do you have an idea why?
There was a problem hiding this comment.
Uh, I don't know 😅 . I can add it as Normal of its imaginary & real parts, but I don't know if it makes sense.
There was a problem hiding this comment.
If something is not added, it can be added later 🤷
HurricanKai
left a comment
There was a problem hiding this comment.
Can you also change the constraints for Sin and such?
| #endif | ||
| #if SSE | ||
| using System.Runtime.Intrinsics.X86; | ||
| // ReSharper disable CompareOfFloatsByEqualityOperator |
There was a problem hiding this comment.
Moved out of the #if please
HurricanKai
left a comment
There was a problem hiding this comment.
Looking good. Just missing Scalsr and a bunch of MathFPort stuffs for full support 🙌
* improving math * Unconstrained * warnings suppressed * WIP: Adding BigInteger and Complex * Keeping adding * #if-ed unavailable API * Other unavailable API #ifed * I love typos * Abs for Complex added. Tests * Tests added * notnull constraint added * Suppress moved out of #if * MathFPort constraints changed to notnull



Summary of the PR
Unconstraining
TinScalar<>and addingBigIntegerandComplex