powrAuthors: Stephen Heumann
Date: 2026-04-22
Submitted against: C23
Status: Open
In C23 7.12.8.7, the synopsis for the powr functions shows that the
first parameter is named y and the second is named x:
double powr(double y, double x);
(and similarly for powrf, powrl, powrd32, powrd64, and
powrd128).
The description then says that
The
powrfunctions computexraised to the poweryas eylogex.
So the powr functions are specified as computing their second
argument raised to the power of their first argument. This is the
opposite order of arguments from the original specification of powr
in TS 18661-4:2015. It is also the opposite order of arguments from
pow.
This change to the order of arguments is likely to cause confusion,
and I can find no record that the committee did it intentionally, so
it may be an editorial error. Moreover, most of the special cases for
powr specified in F.10.5.7 do not make sense mathematically if
powr actually computes its second argument raised to the power of
its first argument.
The standard should be clarified to indicate the actually intended
order of arguments for the powr functions. I suggest changing it
back to match TS 18661-4:2015.
In C23 7.12.8.7 paragraph 1 (Synopsis) and B.11, change all the powr
functions to have x as the first parameter and y as the second.