Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(90)  |  Call(90)  |  Derive(0)  |  Import(0)

            def f(x, **kwargs):
        if type(x) is float:
            return f_real(x)
        if type(x) is complex:
            return f_complex(x)
        try:
            x = float(x)
            return f_real(x)
        except (TypeError, ValueError):
            x = complex(x)
            return f_complex(x)
        


src/s/y/sympy-0.7.5/sympy/mpmath/tests/test_fp.py   sympy(Download)
def test_fp_cospi_sinpi():
    assert ae(fp.sinpi(0), 0.0)
    assert ae(fp.sinpi(0.25), 0.7071067811865475244)
    assert ae(fp.sinpi(0.5), 1.0)
    assert ae(fp.sinpi(0.75), 0.7071067811865475244)
    assert ae(fp.sinpi(1), 0.0)

src/s/y/sympy-HEAD/sympy/mpmath/tests/test_fp.py   sympy(Download)
def test_fp_cospi_sinpi():
    assert ae(fp.sinpi(0), 0.0)
    assert ae(fp.sinpi(0.25), 0.7071067811865475244)
    assert ae(fp.sinpi(0.5), 1.0)
    assert ae(fp.sinpi(0.75), 0.7071067811865475244)
    assert ae(fp.sinpi(1), 0.0)

src/s/y/sympy-polys-HEAD/sympy/mpmath/tests/test_fp.py   sympy-polys(Download)
def test_fp_cospi_sinpi():
    assert ae(fp.sinpi(0), 0.0)
    assert ae(fp.sinpi(0.25), 0.7071067811865475244)
    assert ae(fp.sinpi(0.5), 1.0)
    assert ae(fp.sinpi(0.75), 0.7071067811865475244)
    assert ae(fp.sinpi(1), 0.0)