logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

float.c: handle round-up-to-denorm correctly.: msg#00107

Subject: float.c: handle round-up-to-denorm correctly.
Date: Tue, 30 Oct 2007 01:13:09 -0700

---
 float.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/float.c b/float.c
index bd2cd58..39bd357 100644
--- a/float.c
+++ b/float.c
@@ -724,20 +724,15 @@ static int to_float(const char *str, int s, uint8_t * 
result,
             exponent--;
             if (exponent >= 2 - expmax && exponent <= expmax) {
                type = FL_NORMAL;
-            } else if (exponent < 2 - expmax &&
-                       exponent >= 2 - expmax - fmt->mantissa) {
-               type = FL_DENORMAL;
             } else if (exponent > 0) {
                if (pass0 == 1)
                    error(ERR_WARNING|ERR_WARN_FL_OVERFLOW,
                          "overflow in floating-point constant");
                type = FL_INFINITY;
            } else {
-               /* underflow */
-               if (pass0 == 1)
-                   error(ERR_WARNING|ERR_WARN_FL_UNDERFLOW,
-                         "underflow in floating-point constant");
-               type = FL_ZERO;
+               /* underflow or denormal; the denormal code handles
+                  actual underflow. */
+               type = FL_DENORMAL;
            }
        } else {
            /* Zero */
-- 
1.5.3.4


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/


<Prev in Thread] Current Thread [Next in Thread>