This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Draft "Unsafe fp optimizations" project description.
- To: dewar at gnat dot com
- Subject: Re: Draft "Unsafe fp optimizations" project description.
- From: Brad Lucier <lucier at math dot purdue dot edu>
- Date: Mon, 6 Aug 2001 22:40:28 -0500 (EST)
- Cc: lucier at math dot purdue dot edu, gcc at gcc dot gnu dot org, toon at moene dot indiv dot nluug dot nl
> 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.