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/07 19:43:43 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6991: Fixed pow() for negative bases.

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