Skip to content
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

Create a number primitive. #7

Closed
10 tasks
tacosontitan opened this issue Feb 6, 2024 · 1 comment
Closed
10 tasks

Create a number primitive. #7

tacosontitan opened this issue Feb 6, 2024 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@tacosontitan
Copy link
Owner

tacosontitan commented Feb 6, 2024

A primitive capable of handling the primitive types of C# would help simplify a lot of golf snippets. This type will be known simply as Number and consumable as N:

N foo = 3.14159f;

Ideally, we should have a file per interface implementation required to support the type:

    public readonly struct Number
        : IComparable,
          IConvertible,
          ISpanFormattable,
          IComparable<Number>,
          IEquatable<Number>,
          IBinaryInteger<Number>,
          IMinMaxValue<Number>,
          ISignedNumber<Number>,
          IUtf8SpanFormattable,
          IBinaryIntegerParseAndFormatInfo<Number>

Then one per native primitive being supported to handle conversions:

  • byte
  • short
  • ushort
  • int
  • uint
  • long
  • ulong
  • decimal
  • float
  • double

This will likely be the most verbose primitive type the project will have. As a result, the support for each native primitive is approved to be defined in its own file under a folder named Number which is marked as not a namespace provider, as is typical of all folders in the repo. The naming format should be *Functions where * represents the native type (e.g. ByteFunctions) or similar to ensure functionality can be maintained in bite-sized chunks.

@tacosontitan tacosontitan added enhancement New feature or request help wanted Extra attention is needed labels Feb 6, 2024
@tacosontitan tacosontitan added this to the Primitives milestone Feb 6, 2024
@tacosontitan tacosontitan linked a pull request Apr 13, 2024 that will close this issue
@tacosontitan tacosontitan removed a link to a pull request Apr 13, 2024
@tacosontitan
Copy link
Owner Author

Replaced by the following issues:

#32
#33
#34
#35
#36
#37
#38
#39
#40
#41
#42

@tacosontitan tacosontitan added this to the Initial Release milestone Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Status: Done
Development

No branches or pull requests

1 participant