-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[RFC]: move @stdlib/math/base/ops/* packages to @stdlib/number/* and @stdlib/complex/* #2261
Copy link
Copy link
Closed
Labels
AcceptedRFC feature request which has been accepted.RFC feature request which has been accepted.MaintainersIssue which should be handled by project maintainers & is not recommended for external contributors.Issue which should be handled by project maintainers & is not recommended for external contributors.MathIssue or pull request specific to math functionality.Issue or pull request specific to math functionality.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.release: MajorBreaking change requiring a new major release.Breaking change requiring a new major release.
Metadata
Metadata
Assignees
Labels
AcceptedRFC feature request which has been accepted.RFC feature request which has been accepted.MaintainersIssue which should be handled by project maintainers & is not recommended for external contributors.Issue which should be handled by project maintainers & is not recommended for external contributors.MathIssue or pull request specific to math functionality.Issue or pull request specific to math functionality.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.release: MajorBreaking change requiring a new major release.Breaking change requiring a new major release.
Description
This RFC proposes moving packages found in
@stdlib/math/base/opsto respective sub-namespaces in@stdlib/number/*and@stdlib/complex/*. For example,@stdlib/math/base/ops/add=>@stdlib/number/float64/base/add@stdlib/math/base/ops/addf=>@stdlib/number/float32/base/addCurrently, we rely on prefixes and suffixes to distinguish packages in
ops; however, this practice breaks down when wanting to add C variants for various integer dtypes. To keep things cleaner, this RFC advocates for migrating to dedicated dtype sub-namespaces for arithmetic, binary, and logical operations, where the latter were already planned for dtype sub-namespaces. Moving their arithmetic counterparts seems better for the sake of consistency than following themath/base/specialprecedent which stems from C99 and is primarily oriented to floating-point numbers.Related Issues
@stdlib/complexinto sub-namespaces #2260Questions
No.
Other
Note that this RFC does not propose changing
math/base/special. This applies only toopswhich are more universal for each numeric dtype, and where we do actually want dedicated C interfaces for each dtype (e.g.,int8_t stdlib_base_int8_add( int8_t x, int8_t y )).The migration path would be as follows:
@stdlib/math/base/opsnamespace.cc @Planeshifter
Checklist
RFC:.