Draft "Unsafe fp optimizations" project description.

Brad Lucier lucier@math.purdue.edu
Mon Aug 6 20:43:00 GMT 2001


> with Text_IO; use Text_IO;
> procedure k is
>    a : float := -0.0;
>    b : float := +0.0;
> 
> begin
>    Put_Line (Float'Image (b - a));
>    Put_line (Float'Image (-b + a));

This should be

>    Put_line (Float'Image (-a + b));

if you want the expressions to be equivalent.

> end;
> 
> The output of this is
> 
>  0.00000E+00
> -0.00000E+00
> 
> This minus zero stuff is tricky!

I agree.



More information about the Gcc mailing list