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

docs, test, fix: Fit Fast_Power to contributing guidelines and fix bug #2888

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

endorphin-naixu
Copy link

Fit Fast_Power to contributing guidelines.
Return NAN when the base is 0 and the exponent is non-positive
I noticed that the original test program used "==" to test the result, and when the exponent is negative, it is obviously unreasonable to use "==" to compare two floating-point numbers, so I introduced a value "epsilon = 1e-8" as the error range.
Delete the useless output from the original test code and keep only the output of "All tests have successfully passed!".

Description of Change

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes:
Fix issue #2456

…bug in the algorithm calculating non-positive exponents of 0
math/fast_power.cpp Outdated Show resolved Hide resolved
math/fast_power.cpp Outdated Show resolved Hide resolved
math/fast_power.cpp Outdated Show resolved Hide resolved
@endorphin-naixu
Copy link
Author

Please take a look @realstealthninja

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants