[Cfp-interest 1949] pow(+1.,+/-infinity)

Fred J. Tydeman tydeman at tybor.com
Wed Mar 24 07:15:03 PDT 2021


IEEE 754-2019

Clause 9.2.1 Special values has:

pow(+1, y) is 1 for any y (even a quiet NaN)


Clause 9.2.2 Preferred exponents has:

The preferred exponent for operations in sub-clause 9.2 is 0, except
for the following:

Q(pow(x, y)) is floor(y * Q(x))


Using 7 digit decimal floating point, I get (inf is infinity):

(1.0)*(1.0)*(1.0) == (10e-1)*(10e-1)*(10e-1) == 1000e-3 == 1.000

Q(pow(+1.0,+3)) == floor(+3*Q(10e-1)) == floor(+3*-1) == -3
=> 1000e-3 == 1.000

Q(pow(+1.00,+inf)) == floor(+inf*Q(100e-2)) == floor(+inf*-2) == -inf
=> 1000000e-6 == 1.000000

Q(pow(+1.,+inf)) == floor(+inf*Q(1e0)) == floor(+inf*0) == floor(NaN)
=> Should it be 1000000e-6 or 1e0 or something else?



1./((1.0)*(1.0)*(1.0)) == 1./((10e-1)*(10e-1)*(10e-1))
== 1e0/1000e-3 == .001e3 == 1e0 == 1.

Q(pow(+1.0,-3)) == floor(-3*Q(10e-1)) == floor(-3*-1) == +3
=> 1e0 == 1.

Q(pow(+1.00,-inf)) == floor(-inf*Q(100e-2)) == floor(-inf*-2) == +inf
=> 1e0 == 1.

Q(pow(+1.,-inf)) == floor(-inf*Q(1e0)) == floor(-inf*0) == floor(NaN)
=> Should it be 1e0 or something else?


---
Fred J. Tydeman        Tydeman Consulting
tydeman at tybor.com      Testing, numerics, programming
+1 (702) 608-6093      Vice-chair of PL22.11 (ANSI "C")
Sample C99+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.



More information about the Cfp-interest mailing list