[cfp-interest 3762] Re: pow(x,1)
Damian McGuckin
damianm at esi.com.au
Mon Jan 12 16:04:00 PST 2026
On Fri, 31 Oct 2025, Fred J. Tydeman wrote:
> I assume that pow(x,1) is exactly x [but it is not listed in C23:
> F.10.4.5 pow functions]
This is not an IEEE 754 special case and hence why it is not in C23.
As far as I can tell, there is no IEEE 754 exact special case which
returns a result that is an algebraic argument such as 'x'.
As I read pow(x, 1) in IEEE 754, it is not required to be treated as exact
but I will defer to wiser heads than mine there. Probably the more
relevant question is whether IEEE 754 should do so. And then IEEE 754
needs to do this for pown(), powd() and powr(). And if so, then as per my
earlier email, we should follow suit. Should we pre-empt IEEE 754 2029
a.k.a. ISO 60559 2029? We have enough on our plate.
> scalbn(x,0) is exactly x [as per F.10.4.19 in C23]
>
> So, scalbn(DBL_TRUE_MIN,0) is exactly DBL_TRUE_MIN
This will is required to be exact due to IEEE 754 Clause 7.5. Totally
different to the special cases of Section 9 of IEEE 754.
> And, I assume, pow(DBL_TRUE_MIN,1) should be exactly DBL_TRUE_MIN
As I noted above, I believe that IEEE 754 does not mandate this.
>
> As per C23, 7.12.2#7, those are underflow [since they are subnormal]
> But, as per IEEE-754, they are NOT underflow [since they are exact].
>
> Now, C23 7.12.2#7 allows the implementation to not indicate those
> "underflows". It also allows the implementation to raise FE_UNDERFLOW
> even though IEEE-754 would not raise FE_UNDERFLOW.
> Do we need to add words to C2y about the difference on exact subnormal?
>
> Should pow(x,1) being exactly x be added to Annex F?
My 10c is to say "no" until IEEE 754 says "yes".
Should we kick this back to IEEE 754 and just wait for them?
Note that this is very different to Fred's eagle-eyed realisation that the
IEEE 754 2019 special case of
compound(0, n)
is missing. IEEE 754 2008 did not have this as one of its special cases
which I think is why it was not there since the addition of "compound()"
into the library. See my earlier email.
Thanks - Damian
More information about the cfp-interest
mailing list