------- Comment #88 from egon at heaven dot industries dot cz  2007-01-18 16:29 
-------
>   const volatile double y2 = x + 1.0;

I'd also favor this "selective" approach, because the instability is harmless
in most cases.  But it is dangerous sometimes, as mentioned in the binary
search or when sorting, where the faulty cmpfn() could turn the sort function
to infinite loop.

So, could you please advise a body of hypothetical

double discard_extended_precision(double a);

function (possibly some 387 FP insn?) that reliably truncates the argument to
64bit?  Would

inline double discard_extended_precision(volatile double a) { return a; }

do the trick?


-- 

egon at heaven dot industries dot cz changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |egon at heaven dot
                   |                            |industries dot cz


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323

Reply via email to