[PATCH] various fixes detected with -Wdouble-promotion
Paul Eggert
eggert@cs.ucla.edu
Mon Oct 13 20:43:04 GMT 2025
On 2025-10-13 11:43, Wilco Dijkstra wrote:
>>> - p6 = p[6] + y * -0xf.ff6b8p-12;
>>> + p6 = p[6] + y * -0xf.ff6b8p-12f;
>>>
>>> in the patch show, Glibc would be better off being clean w.r.t
>>> -Wdouble-promotion.
>> no worry, I saw no offense. It is good that we can have different opinions on
>> this list. Personally I wish I had known -Wdouble-promotion before, since this
>> would have saved several times me some time to find why my code was so slow.
> We've tried hard to keep the math code type clean, so almost all float constants use
> the 'f' suffix correctly.
Thanks. For the particular example quoted above, it'd be helpful to add
a comment saying that using float rather than double does not affect the
result (even though a naive reading would make it seem so). Or if this
sort of thing is common in the file, a blanket comment at the start
saying something like "This file uses 'float' computations exclusively;
we've tested, and using 'double' does not increase accuracy." Or
something like that.
More information about the Libc-alpha
mailing list