4a8fb7e9e9441a892622701a85979307c67324e7,mathics/builtin/arithmetic.py,_MPMathFunction,apply,#_MPMathFunction#Any#Any#,43

Before Change


                return

            result = self.call_mpmath(mpmath_function, float_args)
            if isinstance(result, (mpmath.mpc, mpmath.mpf)):
                result = Number.from_mp(result)
        else:
            prec = min_prec(*args)
            with mpmath.workprec(prec):
                sympy_args = [x.to_sympy() for x in args]

After Change


            if isinstance(result, (mpmath.mpc, mpmath.mpf)):
                if mpmath.isinf(result) and isinstance(result, mpmath.mpc):
                    result = Symbol("ComplexInfinity")
                elif mpmath.isinf(result) and result > 0:
                    result = Expression("DirectedInfinity", Integer(1))
                elif mpmath.isinf(result) and result < 0:
                    result = Expression("DirectedInfinity", Integer(-1))
                elif mpmath.isnan(result):
                    result = Symbol("Indeterminate")
                else:
                    result = Number.from_mpmath(result)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: mathics/Mathics
Commit Name: 4a8fb7e9e9441a892622701a85979307c67324e7
Time: 2016-08-05
Author: 16sn6uv@gmail.com
File Name: mathics/builtin/arithmetic.py
Class Name: _MPMathFunction
Method Name: apply


Project Name: mathics/Mathics
Commit Name: 55a2a513c16061469bbbc7bb2a29639fb63ffd24
Time: 2016-08-05
Author: 16sn6uv@gmail.com
File Name: mathics/builtin/numeric.py
Class Name: MachinePrecision
Method Name: apply_N


Project Name: mathics/Mathics
Commit Name: b4bc1373fcd535c2c3d07968f91a25e771babb05
Time: 2021-04-10
Author: matera@fisica.unlp.edu.ar
File Name: mathics/builtin/lists.py
Class Name: AppendTo
Method Name: apply