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

All Samples(3)  |  Call(2)  |  Derive(0)  |  Import(1)
Absolute value of a complex number, |a+bi|.
Returns an mpf value.

        def mpc_abs(z, prec, rnd=round_fast):
    """Absolute value of a complex number, |a+bi|.
    Returns an mpf value."""
    a, b = z
    return mpf_hypot(a, b, prec, rnd)
        


src/s/y/sympy-HEAD/sympy/core/evalf.py   sympy(Download)
        re, re_acc, im, im_acc = im, im_acc, re, re_acc
    if im:
        return libmp.mpc_abs((re, im), prec), None, re_acc, None
    elif re:
        return mpf_abs(re), None, re_acc, None

src/s/y/sympy-polys-HEAD/sympy/core/evalf.py   sympy-polys(Download)
        re, re_acc, im, im_acc = im, im_acc, re, re_acc
    if im:
        return libmp.mpc_abs((re, im), prec), None, re_acc, None
    else:
        return mpf_abs(re), None, re_acc, None

src/s/y/sympy-HEAD/sympy/polys/domains/mpelements.py   sympy(Download)
 
from sympy.mpmath.ctx_mp_python import PythonMPContext, _mpf, _mpc, _constant
from sympy.mpmath.libmp import (MPZ_ONE, fzero, fone, finf, fninf, fnan,
    round_nearest, mpf_mul, mpf_abs, mpf_lt, mpc_abs, repr_dps, int_types,
    from_int, from_float, from_str, to_rational)