Skip to content

(U)Int24 Proposed API #25

@JustNrik

Description

@JustNrik

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

  • IEquatable<Int24>
  • IComparable<Int24>
  • IConvertible
  • IComparable
  • IFormattable

UInt24

  • IEquatable<UInt24>
  • IComparable<UInt24>
  • IConvertible
  • IComparable
  • IFormattable

3. Add the following operators:

Unary Operators

  • Int24 operator +(Int24)
  • Int24 operator -(Int24)
  • UInt24 operator +(UInt24)

Bitwise Complement Operator

  • Int24 operator ~(Int24)
  • UInt24 operator ~(UInt24)

Cast Operators

Int24 -> Signed Number

  • explicit operator sbyte(Int24)
  • explicit operator short(Int24)
  • implicit operator int(Int24)
  • implicit operator long(Int24)

Int24 -> Unsigned Number

  • explicit operator byte(Int24)
  • explicit operator ushort(Int24)
  • explicit operator uint(Int24)
  • explicit operator ulong(Int24)

Signed Number -> Int24

  • explicit operator Int24(int)
  • explicit operator Int24(long)

Unsigned Number -> Int24

  • explicit operator Int24(uint)
  • explicit operator Int24(ulong)

UInt24 -> Int24

  • explicit operator Int24(UInt24)

UInt24 -> Signed Number

  • explicit operator sbyte(UInt24)
  • explicit operator short(UInt24)
  • implicit operator int(UInt24)
  • implicit operator long(UInt24)

UInt24 -> Unsigned Number

  • explicit operator byte(UInt24)
  • explicit operator ushort(UInt24)
  • implicit operator uint(UInt24)
  • implicit operator ulong(UInt24)

Signed Number -> UInt24

  • explicit operator UInt24(int)
  • explicit operator UInt24(long)

Unsigned Number -> UInt24

  • explicit operator UInt24(uint)
  • explicit operator UInt24(ulong)

Int24 -> UInt24

  • explicit operator UInt24(Int24)

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

  • Add tests for Constructors
  • Add tests for Interfaces
  • Add tests for Unary Operators
  • Add tests for Bitwise Complement Operators
  • Add tests for Cast Operators
  • Add tests for Multiplication Operators
  • Add tests for Division Operators
  • Add tests for Remainder Operators
  • Add tests for Addition Operators
  • Add tests for Subtraction Operators
  • Add tests for Shift Operators
  • Add tests for Integer Comparison Operators
  • Add tests for Integer Logical Operators
  • Add tests for Parse
  • Add tests for TryParse

UInt24

  • Add tests for Constructors
  • Add tests for Interfaces
  • Add tests for Unary Operators
  • Add tests for Bitwise Complement Operators
  • Add tests for Cast Operators
  • Add tests for Multiplication Operators
  • Add tests for Division Operators
  • Add tests for Remainder Operators
  • Add tests for Addition Operators
  • Add tests for Subtraction Operators
  • Add tests for Shift Operators
  • Add tests for Integer Comparison Operators
  • Add tests for Integer Logical Operators
  • Add tests for Parse
  • Add tests for TryParse

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions