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/11/24 08:44:30 UTC

[GitHub] [incubator-nuttx] flyingfish89 opened a new pull request, #7677: lib_libvsprintf: fix the float point print bug

flyingfish89 opened a new pull request, #7677:
URL: https://github.com/apache/incubator-nuttx/pull/7677

   ## Summary
   such as code: double value = +0x1.000000000000080000000000p-600;
                 printf("Hello, World!! %.7g:f64\n", value);
   expected output : Hello, World!! 2.40992e-181:f64
   but real output : Hello, World!! 2.40992e-B1:f64
   the reason: we want printf "18", but the flag of character is 'B'
               and 'B' is '0'+18,so printf 'B';
   
   
   Related issue: https://github.com/apache/incubator-nuttx/issues/7620
   
   ## Impact
   float printf
   
   ## Testing
   esp32c3 with test code
   ```c
   double value = +0x1.000000000000080000000000p-600;
   printf("Hello, World!! %.7g:f64\n", value);
   ```
   
   


-- 
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 #7677: lib_libvsprintf: fix the float point print bug

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #7677:
URL: https://github.com/apache/incubator-nuttx/pull/7677#discussion_r1031694312


##########
libs/libc/stdio/lib_libvsprintf.c:
##########
@@ -878,8 +878,32 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream,
                   ndigs += 1;
                 }
 
-              putc(ndigs, stream);
-              putc('0' + exp, stream);
+              /* Parse the ndigs if the value of it bigger than '9' */
+
+              while (1)

Review Comment:
   Maybe better to
   
   ```suggestion
                 while (ndigits > 0)
   ```
   Or something like this. Just from some static alalyzers point of view
   



-- 
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] acassis merged pull request #7677: lib_libvsprintf: fix the float point print bug

Posted by GitBox <gi...@apache.org>.
acassis merged PR #7677:
URL: https://github.com/apache/incubator-nuttx/pull/7677


-- 
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 commented on a diff in pull request #7677: lib_libvsprintf: fix the float point print bug

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7677:
URL: https://github.com/apache/incubator-nuttx/pull/7677#discussion_r1031369800


##########
libs/libc/stdio/lib_libvsprintf.c:
##########
@@ -878,8 +878,32 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream,
                   ndigs += 1;
                 }
 
-              putc(ndigs, stream);
-              putc('0' + exp, stream);
+              /* parse the ndigs if the value of it bigger than '9' */

Review Comment:
   parse->Parse



-- 
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] CV-Bowen commented on a diff in pull request #7677: lib_libvsprintf: fix the float point print bug

Posted by GitBox <gi...@apache.org>.
CV-Bowen commented on code in PR #7677:
URL: https://github.com/apache/incubator-nuttx/pull/7677#discussion_r1031566144


##########
libs/libc/stdio/lib_libvsprintf.c:
##########
@@ -878,8 +878,32 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream,
                   ndigs += 1;
                 }
 
-              putc(ndigs, stream);
-              putc('0' + exp, stream);
+              /* parse the ndigs if the value of it bigger than '9' */

Review Comment:
   Seem done.



-- 
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] flyingfish89 closed pull request #7677: lib_libvsprintf: fix the float point print bug

Posted by GitBox <gi...@apache.org>.
flyingfish89 closed pull request #7677: lib_libvsprintf: fix the float point print bug
URL: https://github.com/apache/incubator-nuttx/pull/7677


-- 
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] no1wudi commented on pull request #7677: lib_libvsprintf: fix the float point print bug

Posted by GitBox <gi...@apache.org>.
no1wudi commented on PR #7677:
URL: https://github.com/apache/incubator-nuttx/pull/7677#issuecomment-1326514767

   Verified on my local machine that this patch can fix #7620


-- 
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