def METHOD_NAME(self, ftype, frac_vals, exp_vals):
    for frac, exp in zip(frac_vals, exp_vals):
        f = np.ldexp(ftype(frac), exp)
        assert f.dtype == ftype
        n, d = f.as_integer_ratio()
        try:
            nf = np.longdouble(n)
            df = np.longdouble(d)
            if not np.isfinite(df):
                raise OverflowError
        except (OverflowError, RuntimeWarning):
            # the values may not fit in any float type
            pytest.skip("longdouble too small on this platform")
        assert_equal(nf / df, f, "{}/{}".format(n, d))