-
-
Notifications
You must be signed in to change notification settings - Fork 441
Unconstraining Scalar ; adding BigInteger and Complex #633
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
Conversation
I haven't worked on Scalar.MathFPort and MissingMethods for now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't feel right, are you sure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I know. But where does the nullability analysis warning come from? Is it not new?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 😆 🦆🦆🦆 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, let's just not then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If something is not added, it can be added later 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved out of the #if please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
T
inScalar<>
and addingBigInteger
andComplex