C++ Logo

std-proposals

Advanced search

Re: [std-proposals] [isocpp-lib-ext] P3935R0 Rebasing <cmath> on C23

From: Hubert Tong <hubert.reinterpretcast_at_[hidden]>
Date: Tue, 25 Nov 2025 13:09:40 -0500
Hi Jan,

Thanks for working on this. My comments so far regarding the proposed
templates and overloads for the "narrow rounding functions"...

C's tgmath.h does not require the arguments to have the same type, but the
templates do have such a requirement when the F type is not explicitly
specified.

Also, C's tgmath.h allows for
f*op*(0., 0.L); // calls the underlying math.h f*op*l function

but the proposed overload sets in C++ each have an ambiguity between the
`double` and `long double` overloads for the above case (whereas the
overload set for `pow` in C++ does not have this problem because of
the "sufficient overloads" provision of https://wg21.link/cmath.syn#3 for
*floating-point-type*).

Aside:
We seem to be missing an Annex C entry documenting the inability to
suppress <tgmath.h>-like behaviour by suppressing macro replacement (e.g.,
via use of parentheses around the "function" name).

-- HT

On Tue, Nov 25, 2025 at 3:18 AM Jan Schultke via Lib-Ext <
lib-ext_at_[hidden]> wrote:

> https://isocpp.org/files/papers/D3935R0.html
>
> Just wanted to let you know that I've begun work on the inevitable rebase
> of C++29's <cmath> on C23.
>
> If anyone wants to help with the effort or champion it, let me know.
>
>
> Jan
> _______________________________________________
> Lib-Ext mailing list
> Lib-Ext_at_[hidden]
> Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/lib-ext
> Link to this post: http://lists.isocpp.org/lib-ext/2025/11/30975.php
>

Received on 2025-11-25 18:10:16