(res)
| 72 | |
| 73 | |
| 74 | def mantexp_values(res): |
| 75 | # [mant_re, exp_re, mant_im, exp_im] with v = mant·10^exp, |mant| ∈ [1,10) |
| 76 | # — grades exact constants whose components exceed float64 range. |
| 77 | out = [] |
| 78 | re_, im_ = res.as_real_imag() |
| 79 | for v in (re_, im_): |
| 80 | r = Rational(v) |
| 81 | f = mpmath.mpf(r.p) / mpmath.mpf(r.q) |
| 82 | if f == 0: |
| 83 | out += [0.0, 0.0] |
| 84 | else: |
| 85 | e = int(mpmath.floor(mpmath.log10(abs(f)))) |
| 86 | out += [float(f / mpmath.power(10, e)), float(e)] |
| 87 | return out |
| 88 | |
| 89 | |
| 90 | for c in SUITE["cases"]: |
no test coverage detected