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

arm_sqrt_q31 return value for input value 0 #164

Closed
marcluque opened this issue Mar 4, 2024 · 3 comments
Closed

arm_sqrt_q31 return value for input value 0 #164

marcluque opened this issue Mar 4, 2024 · 3 comments
Labels
bug Something isn't working DONE Issue done but not yet closed

Comments

@marcluque
Copy link

When working with the arm_sqrt_q31 function, I noticed that it returns ARM_MATH_ARGUMENT_ERROR for input 0. The documentation specifies that the allowed input range is [0, +1). I would expect 0 to return 0 and give ARM_MATH_SUCCESS instead, but it only does the former not the latter. The return value documentation seems to miss the "neutral" case since it specifies:

@return        execution status
                   - \ref ARM_MATH_SUCCESS        : input value is positive
                   - \ref ARM_MATH_ARGUMENT_ERROR : input value is negative; *pOut is set to 0

Perhaps there's a wrong understanding of the code/documentation on my part.

@christophe0606 christophe0606 added the bug Something isn't working label Mar 5, 2024
@christophe0606
Copy link
Contributor

@marcluque It is indeed a bug. A case is missing in the implementation for 0 argument. Same problem for the q15 version.

christophe0606 added a commit that referenced this issue Mar 6, 2024
@christophe0606 christophe0606 added the DONE Issue done but not yet closed label Mar 6, 2024
@christophe0606
Copy link
Contributor

Corrected in commit 0d49aa6

@marcluque
Copy link
Author

Great, thank you very much! I'll close this issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working DONE Issue done but not yet closed
Projects
None yet
Development

No branches or pull requests

2 participants