Source-Changes-D archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: src/tests/lib/libc/locale
On Tue, Nov 28, 2017 at 05:32:45AM +0700, Robert Elz wrote:
> Date: Mon, 27 Nov 2017 18:44:38 +0100
> From: Joerg Sonnenberger <joerg%bec.de@localhost>
> Message-ID: <20171127174438.GA20936%britannica.bec.de@localhost>
>
> | Parsing a string constant is a well-defined
> | operation with precise result. A cross-compiler that doesn't do that
> | correctly is simply broken.
>
> I don't disagree with that, if you can tell me the PR number for the
> bug report on gcc (whichever version it is that the buildbots are using
> to make the i386 builds that babylony5 uses to run the tests) then I
> will happily mark the test as expected to fail on i386 until the PR
> is fixed.
Hidding things until then doesn't actually fix something.
> Tha is, of course, if that is what the problem is - it may also be that
> it is the libc strtod() on i386 that doesn't make the correct (ideal)
> conversion, and if that's true, then the PR number for that but would do
> equally well.
That would be just as big a bug.
> I am not qualified to work out which it is - all I know is that the
> numbers as printed from printf were identical, yet did not compare
> equal, and apparently are equal within 1e-7, as the test now "works".
You might try to printf them with %a instead.
> Way back when I first learned floating point programming (something I
> have done astonishingly little of in the intervening decades) I was
> told it was *always* wrong to compare floats for exact equality - but
> of course, that was back in the days when almost all computing was
> numerical (simultaneous equation solfving, ffts, ...) and almost all
> written in fortran (the only language worthy of using) ...
The reference paper for precise conversion between binary and decimal
for floating point values is from 1990, which is quite surprisingly
late.
Joerg
Home |
Main Index |
Thread Index |
Old Index