This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: What is acceptable for -ffast-math? (Was: associative law in combine)


<<Full safety is IMHO impossible with floating point... Only the
programmer knows the accuracy of its input data (Linus called that
noise) and the accuracy he expects on its result.
>>

Now that statement really cannot be let go by.

Of course it is possible to write safe and reliable floating-point code, but
in general this is only feasible if you have a sensible floating-point model
(e.g. IEEE), and you have a well understood mapping between the high level
language and the floating-point model.

THe viewpoint that floating-point is inherently sloppy is an unhelpful
and archaic one. It is the sort of thing that gives rise to idiotic advice
like "never use absolute equality on floating-point values".

Now of course a lot of code is written in a very much less safe and reliable
manner, and indeed, one can considerably relax the model much of the time.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]