iso_varying_string regression needs high priority

Steve Kargl sgk@troutmask.apl.washington.edu
Mon Dec 22 07:10:00 GMT 2008


On Sun, Dec 21, 2008 at 08:34:49PM -0800, Jerry DeLisle wrote:
> Hi folks,
> 
> This bug, pr38602, needs to take high priority I think.
> 
> Its in an area that I can not help directly.  I am starting a regression 
> hunt.
> 
> If anyone finds the suspect patch first, let me know.
> 

Part of the patch doesn't make any sense to me.

   int i;\
-  GFC_REAL_ ## x r = 1.0;\
+  GFC_REAL_ ## x r = 1.0 ## y;\
   for (i = 0; i< (d >= 0 ? d : -d); i++)\
-    r *= 10;\
+    r *= 10.0 ## y;\


1.0 and 10 are exactly representable in all floating point formats.
Your change should not be needed.  If anything I'd change 1.0 to 
simply the integer 1.

       temp = 0.1 * calculate_exp_ ## x (mid) - 0.5\
-            * calculate_exp_ ## x (mid - d - 1);\
+            * calculate_exp_4 (mid - d - 1);\

I suspect the problem lies in 0.1.  It isn't exactly representable
and you're subject to rounding errors.  Can you use 

temp = (calculate_exp_ ## x (mid) - 5 * calculate_exp_ ## x (mid - d - 1));
temp /= 10;

-- 
Steve



More information about the Fortran mailing list