This is an automatically generated file.
Part 1
Part 2
# =============================================
# Tests of X**K for integer X and K.
# =============================================
def test_power_result(x, z, q):
"""Check that x equals z**q, usually for exact integer cases."""
global pow_err_cnt
y = pow(z, q)
if ultra_verbose:
print("\t{:.17e} = {:.17e} ^ {:.17e}".format(y, z, q))
if y != x:
Part 3
if pow_err_cnt <= 0:
if z == ZERO and q <= ZERO:
print("WARNING: computing")
else:
bad_cond(err_defect, "computing")
print("\t({:0.17e}) ^ ({:0.17e})".format(z, q))
print("\tyielded {:0.17e};\n".format(y))
print("\twhich compared unequal to correct {:0.17e} ;"
.format(x))
print("\t\tthey differ by {:0.17e} .".format(y - x))
pow_err_cnt += 1 # ... count discrepancies.
return
Part 4