3682971abb85dd12991152d55cb687e259331419,mathics/builtin/numeric.py,Round,apply,#Round#Any#Any#Any#,432

Before Change


        nexpr = expr.numerify(evaluation)
        nexpr.to_mpmath()

        n = int((expr.to_sympy() / k.to_sympy()).round().as_real_imag()[0])
        return Expression("Times", Integer(n), k)


def chop(expr, delta=10.0 ** (-10.0)):

After Change



        n = Expression("Divide", expr, k).round_to_float(evaluation, permit_complex=True)
        if n is None:
            return
        elif isinstance(n, complex):
            n = round(n.real)
        else:
            n = round(n)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: mathics/Mathics
Commit Name: 3682971abb85dd12991152d55cb687e259331419
Time: 2016-08-10
Author: 16sn6uv@gmail.com
File Name: mathics/builtin/numeric.py
Class Name: Round
Method Name: apply


Project Name: mathics/Mathics
Commit Name: 0402dcc2793e0dd71154c8482c17e291aa877ddd
Time: 2016-08-05
Author: 16sn6uv@gmail.com
File Name: mathics/builtin/arithmetic.py
Class Name: Im
Method Name: apply_complex


Project Name: mathics/Mathics
Commit Name: 0402dcc2793e0dd71154c8482c17e291aa877ddd
Time: 2016-08-05
Author: 16sn6uv@gmail.com
File Name: mathics/builtin/arithmetic.py
Class Name: Re
Method Name: apply_complex