You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/09/02 15:53:22 UTC
[GitHub] [incubator-nuttx] fjpanag opened a new pull request, #6991: Fixed pow() for negative bases.
fjpanag opened a new pull request, #6991:
URL: https://github.com/apache/incubator-nuttx/pull/6991
## Summary
Fixes `pow()` when negative numbers are used as a base.
See #6941 for more information.
## Impact
Correct calculations in `pow()` for all inputs.
## Testing
Tested a few sample cases in simulator.
The results seem correct.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #6991: Fixed pow() for negative bases.
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #6991:
URL: https://github.com/apache/incubator-nuttx/pull/6991
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6991: Fixed pow() for negative bases.
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6991:
URL: https://github.com/apache/incubator-nuttx/pull/6991#discussion_r965209676
##########
libs/libc/math/lib_pow.c:
##########
@@ -41,6 +41,22 @@
#ifdef CONFIG_HAVE_DOUBLE
double pow(double b, double e)
{
- return exp(e * log(b));
+ if (b > 0)
Review Comment:
I'm not sure if that matters, but better to
```suggestion
if (b > .0)
```
and same for line 48
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org