-
Notifications
You must be signed in to change notification settings - Fork 19
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
(U)Int24 Proposed API #25
Comments
Dibs. |
Is it possible to implement an |
Feel free to provide your implementation, I have no idea how to implement those lol. (U)Int128 is already going to be a thing in .NET 6 or 7 iirc. |
I mean I do not think they can add them in .NET 6 or 7 yet because there lacks a language change to add an So ye they need to add keywords for them to a language version first before finalizing it in to the runtime / framework code in order to be able to use them. |
@AraHaan Hello I want to push my Test Code that ive created but I dont have access. Please allow me to push my branch for reviewment and maybe pull request :) Dont know where to @ you otherwise :) |
One way to do this without permission is to Fork the repo. This makes a copy of the repo under your GitHub account. Then you make a branch and push it to your fork. Then open a pull request with the target branch as Main or develop of the original repo. |
That is how I do it as well because there are security reasons for doing it where everyone must use a fork to PR changes in. Mainly because users with direct write access can commit anything to the main branch without reviews so then we would not know if someone could have added some trojan source into it until a tool (or github) tells us about it. |
The implementation of this type should satisfy the followings:
Note: If you help with this issue, please do it on feature-(U)Int24 branch, Thanks.
1. Add these constructors
Int24(byte)
Int24(sbyte)
Int24(short)
Int24(ushort)
Int24(int)
Int24(uint)
Int24(long)
Int24(ulong)
Int24(nint)
Int24(nuint)
Int24(UInt24)
Int24(byte[])
Int24(byte[], int)
Int24(ReadOnlySpan<byte>)
UInt24(byte)
UInt24(sbyte)
UInt24(short)
UInt24(ushort)
UInt24(int)
UInt24(uint)
UInt24(long)
UInt24(ulong)
UInt24(nint)
UInt24(nuint)
UInt24(Int24)
UInt24(byte[])
UInt24(byte[], int)
UInt24(ReadOnlySpan<byte>)
2. Properly implement the following interfaces:
Int24
UInt24
3. Add the following operators:
Unary Operators
Bitwise Complement Operator
Cast Operators
Int24 -> Signed Number
Int24 -> Unsigned Number
Signed Number -> Int24
Unsigned Number -> Int24
UInt24 -> Int24
UInt24 -> Signed Number
UInt24 -> Unsigned Number
Signed Number -> UInt24
Unsigned Number -> UInt24
Int24 -> UInt24
Multiplication Operator
Int24 operator *(int, Int24)
Int24 operator *(Int24, int)
Int24 operator *(Int24, Int24)
UInt24 operator *(uint, UInt24)
UInt24 operator *(UInt24, uint)
UInt24 operator *(UInt24, UInt24)
Division Operator
Int24 operator /(int, Int24)
Int24 operator /(Int24, int)
Int24 operator /(Int24, Int24)
UInt24 operator /(uint, UInt24)
UInt24 operator /(UInt24, uint)
UInt24 operator /(UInt24, UInt24)
Remainder Operator
Int24 operator %(int, Int24)
Int24 operator %(Int24, int)
Int24 operator %(Int24, Int24)
UInt24 operator %(uint, UInt24)
UInt24 operator %(UInt24, uint)
UInt24 operator %(UInt24, UInt24)
Addition Operator
Int24 operator +(int, Int24)
Int24 operator +(Int24, int)
Int24 operator +(Int24, Int24)
UInt24 operator +(uint, UInt24)
UInt24 operator +(UInt24, uint)
UInt24 operator +(UInt24, UInt24)
Subtraction Operator
Int24 operator -(int, Int24)
Int24 operator -(Int24, int)
Int24 operator -(Int24, Int24)
UInt24 operator -(uint, UInt24)
UInt24 operator -(UInt24, uint)
UInt24 operator -(UInt24, UInt24)
Shift Operator
Int24 operator <<(Int24, int)
Int24 operator >>(Int24, int)
UInt24 operator <<(UInt24, uint)
UInt24 operator >>(UInt24, uint)
Integer Comparison Operators
bool operator ==(int, Int24)
bool operator ==(Int24, int)
bool operator ==(Int24, Int24)
bool operator !=(int, Int24)
bool operator !=(Int24, int)
bool operator !=(Int24, Int24)
bool operator <(int, Int24)
bool operator <(Int24, int)
bool operator <(Int24, Int24)
bool operator >(int, Int24)
bool operator >(Int24, int)
bool operator >(Int24, Int24)
bool operator <=(int, Int24)
bool operator <=(Int24, int)
bool operator <=(Int24, Int24)
bool operator >=(int, Int24)
bool operator >=(Int24, int)
bool operator >=(Int24, Int24)
bool operator ==(uint, UInt24)
bool operator ==(UInt24, uint)
bool operator ==(UInt24, UInt24)
bool operator !=(uint, UInt24)
bool operator !=(UInt24, uint)
bool operator !=(UInt24, UInt24)
bool operator <(uint, UInt24)
bool operator <(UInt24, uint)
bool operator <(UInt24, UInt24)
bool operator >(uint, UInt24)
bool operator >(UInt24, uint)
bool operator >(UInt24, UInt24)
bool operator <=(uint, UInt24)
bool operator <=(UInt24, uint)
bool operator <=(UInt24, UInt24)
bool operator >=(uint, UInt24)
bool operator >=(UInt24, uint)
bool operator >=(UInt24, UInt24)
Integer Logical Operators
Int24 operator &(int, Int24)
Int24 operator &(Int24, int)
Int24 operator &(Int24, Int24)
Int24 operator |(int, Int24)
Int24 operator |(Int24, int)
Int24 operator |(Int24, Int24)
Int24 operator ^(int, Int24)
Int24 operator ^(Int24, int)
Int24 operator ^(Int24, Int24)
UInt24 operator &(uint, UInt24)
UInt24 operator &(UInt24, uint)
UInt24 operator &(UInt24, UInt24)
UInt24 operator |(uint, UInt24)
UInt24 operator |(UInt24, uint)
UInt24 operator |(UInt24, UInt24)
UInt24 operator ^(uint, UInt24)
UInt24 operator ^(UInt24, uint)
UInt24 operator ^(UInt24, UInt24)
4. Add Parse and TryParse static methods and Min/Max Value constants
Int24 MaxValue
Int24 MinValue
Int24 Parse(string)
Int24 Parse(string, NumberStyles)
Int24 Parse(string, NumberStyles, IFormatProvider?)
bool TryParse(string, out Int24)
bool TryParse(string, NumberStyles, out Int24)
bool TryParse(string, NumberStyles, IFormatProvider?, out Int24)
UInt24 MaxValue
UInt24 MinValue
UInt24 Parse(string)
UInt24 Parse(string, NumberStyles)
UInt24 Parse(string, NumberStyles, IFormatProvider?)
bool TryParse(string, out UInt24)
bool TryParse(string, NumberStyles, out UInt24)
bool TryParse(string, NumberStyles, IFormatProvider?, out UInt24)
5. Add documentation to all public members (except operators)
Int24 Constructors
UInt24 Constructors
Int24 MaxValue
Int24 MinValue
Int24 Parse(string)
Int24 Parse(string, NumberStyles)
Int24 Parse(string, NumberStyles, IFormatProvider?)
bool TryParse(string, out Int24)
bool TryParse(string, NumberStyles, out Int24)
bool TryParse(string, NumberStyles, IFormatProvider?, out Int24)
UInt24 MaxValue
UInt24 MinValue
UInt24 Parse(string)
UInt24 Parse(string, NumberStyles)
UInt24 Parse(string, NumberStyles, IFormatProvider?)
bool TryParse(string, out UInt24)
bool TryParse(string, NumberStyles, out UInt24)
bool TryParse(string, NumberStyles, IFormatProvider?, out UInt24)
6. Add tests to ensure all the implementation is correct.
Int24
UInt24
The text was updated successfully, but these errors were encountered: