Joe Buck wrote:

The problem is that the user can independently set the IEEE rounding mode.
This means that you can only fold floating point constants in cases where
the generated result is exact; you cannot fold 1./3. for example.

Also, you should not assume that the user wants the kinds of diagnostics
you describe; they might *want* the Infinity or NaN they generated

That's a bit more extreme statement of the requirements. Does C++ require IEEE compliance to this extent? EVen if it does, it is reasonable to have an option (probably the default) in which fpt is folded (of course it is mandatory to use a simulator that will give EXACTLY the results that would have been obtained if the expression had been evaluated at run time. In practice everyone uses round to nearest even.




Reply via email to