xiaoxiang781216 commented on code in PR #7724:
URL: https://github.com/apache/nuttx/pull/7724#discussion_r1034899307


##########
libs/libc/stdlib/lib_strtof.c:
##########
@@ -228,27 +294,53 @@ float strtof(FAR const char *str, FAR char **endptr)
           p++;
         }
 
-      if (negative)
+      if (flag_sixt == 1)
         {
-          exponent -= n;
+          if (negative)
+            {
+              exponent = (exponent *4) - n;
+            }
+          else
+            {
+              exponent = (exponent *4) + n;
+            }
         }
       else
         {
-          exponent += n;
+          if (negative)
+            {
+              exponent -= n;
+            }
+          else
+            {
+              exponent += n;
+            }
         }
     }
 
   if (exponent < __FLT_MIN_EXP__ ||
       exponent > __FLT_MAX_EXP__)
     {
       set_errno(ERANGE);
-      number = infinite;
+      if (exponent < __FLT_MIN_EXP__)
+        {
+          number = divzero;
+        }
+      else
+        {
+          number = infinite;
+        }
+
       goto errout;
     }
 
   /* Scale the result */
 
-  p10 = 10.0F;
+  if (flag_sixt == 1)
+    {
+      p10 = 2.0f;

Review Comment:
   why divide by 2 not 16



-- 
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-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to