[cfp-interest 3936] Re: FW: [SC22WG14.36462] nexttoward wording does not establish exception to conversion required by nextafter
RAJAN BHAKTA
rbhakta at us.ibm.com
Wed May 13 11:52:02 PDT 2026
Example from Hubert of where this can matter if long double precision is higher:
#include <float.h>
#include <math.h>
#include <assert.h>
int main(void) {
assert(nexttoward(1., .25L * DBL_EPSILON + 1.) == 1. + DBL_EPSILON);
}
Regards,
Rajan Bhakta
From: cfp-interest <cfp-interest-bounces at oakapple.net> on behalf of RAJAN BHAKTA <rbhakta at us.ibm.com>
Date: Monday, May 11, 2026 at 1:16 PM
To: cfp-interest at oakapple.net <cfp-interest at oakapple.net>
Subject: [EXTERNAL] [cfp-interest 3924] FW: [SC22WG14.36462] nexttoward wording does not establish exception to conversion required by nextafter
This Message Is From an External Sender
This message came from outside your organization.
Report Suspicious<https://us-phishalarm-ewt.proofpoint.com/EWT/v1/AdhS1Rd-!-_FVP3geXk9bWls5zoTAUZhI-sZgMRMNdLQx1a2WszG-I2l-TwZqweVTk_XzXOHi529JloYQPo4snERPjc5NCJ7p7r5eU4Ek53_iN6y7HqIEHFwbzarJGvk2KGyLoBgrrwmAaA-kPA$>
New item for discussion in our May meeting from WG14.
Regards,
Rajan Bhakta
From: owner-sc22wg14 at open-std.org <owner-sc22wg14 at open-std.org> on behalf of Hubert Tong <hubert.reinterpretcast at gmail.com>
Date: Monday, May 11, 2026 at 12:00 AM
To: ISO C <sc22wg14 at open-std.org>
Subject: [EXTERNAL] [SC22WG14.36462] nexttoward wording does not establish exception to conversion required by nextafter
This Message Is From an Untrusted Sender
You have not previously corresponded with this sender.
Report Suspicious<https://us-phishalarm-ewt.proofpoint.com/EWT/v1/AdhS1Rd-!9FFbMlZykg_b1dV5LuSAsUyqSyQdTuWgR0hE6aeGAPkmcTmjPeILUPfX-iERf5LfadSlCU8-iPC_mGhVr2yfJqEOxeA$>
Hi all,
The description of nexttoward has:
The nexttoward functions are equivalent to the nextafter functions except that the second parameter has type long double or _Decimal128 and the functions return the numerical value resulting from converting y to the return type of the function if x equals y.
and the description of nextafter has:
The nextafter functions determine the next representable value, in the return type of the function,
after x in the direction of y, where x and y are first converted to the return type of the function. The
nextafter functions return the numerical value of y if x equals y.
The nexttoward wording establishes that its second parameter has a different type than that of nextafter, but it does not establish that the second parameter is not "first converted to the return type of the function".
Perhaps the description of nextafter should say "where each of x and y is first converted to the type of the respective parameter"?
Thanks,
Hubert Tong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20260513/3dd1765f/attachment-0001.htm>
More information about the cfp-interest
mailing list