[Bug go/63269] libgo/math test failures in TestLog2
vogt at linux dot vnet.ibm.com
gcc-bugzilla@gcc.gnu.org
Wed Nov 5 14:34:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63269
--- Comment #4 from Dominik Vogt <vogt at linux dot vnet.ibm.com> ---
regarding 2)
> I'm not entirely persuaded by your argument for item 2. ...
Hm, good that you doubted it, because the actual mistake is somehwere else:
The unpatched code has
if l != float64(i)
but if you want to use a tolerance here this must become
if !veryclose(float64(i), l) {
With the argument reversed. This could/should be cleaned up by renaming the
arguments of the tolerance() function, e.g. a -> expected, b -> result, e ->
maxerr.
> Zero is a special
> value. When we expect a zero, we should get a zero, not something close to
> zero. I don't think this change is correct in general. It may be correct for
> some specific cases, but then we need to investigate those.
Actually, this has nothing to do with 0 being special here, abut with scaling
of the allowed error: Multiplying it by 0 yields zero error tolerance, so the
tolerance() function does not do that.
--> This chunk is not necessary, but a (separate) cleanup patch might help to
avoid future confusion.
More information about the Gcc-bugs
mailing list