-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: add math/base/special/roundbf
#9679
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
base: develop
Are you sure you want to change the base?
Conversation
Coverage Report
The above coverage report was generated for the changes in this PR. |
|
|
||
| - **x**: `[in] float` input value. | ||
| - **n**: `[in] int32_t` power. | ||
| - **b**: `[in] int32_t` base. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type for b in the C documentation doesn't match the actual implementation. The C header and main.c use const float b, but the docs say int32_t.
| - **b**: `[in] int32_t` base. | |
| - **b**: `[in] float` base. |
| - **b**: `[in] int32_t` base. | ||
|
|
||
| ```c | ||
| float stdlib_base_roundbf( const float x, const int32_t n, const int32_t b ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue here - the actual signature uses const float b, not const int32_t b.
| float stdlib_base_roundbf( const float x, const int32_t n, const int32_t b ); | |
| float stdlib_base_roundbf( const float x, const int32_t n, const float b ); |
| int main( void ) { | ||
| const float x[] = { 3.14f, -3.14f, 5.0f, -5.0f }; | ||
| const int32_t n[] = { -2, -2, 1, 1 }; | ||
| const int32_t b[] = { 10, 10, 2, 2 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type should be float to match the actual function signature.
| const int32_t b[] = { 10, 10, 2, 2 }; | |
| const float b[] = { 10.0f, 10.0f, 2.0f, 2.0f }; |
|
Hi @Planeshifter, Thankyou for caching up. I have updated the |
Resolves None
Description
This pull request:
math/base/special/roundbf.Related Issues
This pull request has the following related issues:
Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
@stdlib-js/reviewers