feat: add C implementation for math/base/special/gcd
#1701
Labels
Accepted
RFC feature request which has been accepted.
C
Issue involves or relates to C.
difficulty: 2
May require some initial design or R&D, but should be straightforward to resolve and/or implement.
Feature
Issue or pull request for adding a new feature.
Math
Issue or pull request specific to math functionality.
Native Addons
Issue involves or relates to Node.js native add-ons.
priority: Normal
Normal priority concern or feature request.
RFC
Request for comments. Feature requests and proposed changes.
Description
This RFC proposes adding C implementation for
@stdlib/math/base/special/gcd
.I have implementation ready for C implementation of gcd. There are a few issues associated.
This is the definition I am currently using. The file test.native.js is failing for the following cases:
Since I am using inputs as two 32-bit signed integers, these will fail as we can't take input as NaN, infinity, and >= 2**31 - 1 cases. So, how should I tackle this issue? Also, the output type I have used is double for the above definition with two 32-bit signed integers as input we won't get any double output including NaN and it will be better to use a 32-bit signed integer for output as well.
To support >= 2**31 - 1 cases, we can have 64-bit signed integers as input and corresponding output of the same type. But for this, I will have to implement the macro that accepts signed 64-bit integers as input and gives the same output. Now, if we need to implement this then what should be the representation for this macro?
This is the representation used for 32-bit integers as input and the corresponding output as a 32-bit integer.
Related Issues
None.
Questions
No.
Other
No.
Checklist
RFC:
.The text was updated successfully, but these errors were encountered: