7580e6dde9e0def18c1bea96e6a80f472d033c82,mathics/builtin/comparison.py,,do_cmp,#Any#Any#,288

Before Change




def do_cmp(x1, x2):
    real1, real2 = x1.get_float_value(), x2.get_float_value()
    inf1 = inf2 = None
    if x1.has_form("DirectedInfinity", 1):
        inf1 = x1.leaves[0].get_int_value()

After Change


def do_cmp(x1, x2):
    inf1 = inf2 = real1 = real2 = None
    if isinstance(x1, (Real, Integer, Rational)):
        real1 = x1.to_sympy()
    if isinstance(x2, (Real, Integer, Rational)):
        real2 = x2.to_sympy()
    if x1.has_form("DirectedInfinity", 1):
        inf1 = x1.leaves[0].get_int_value()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: mathics/Mathics
Commit Name: 7580e6dde9e0def18c1bea96e6a80f472d033c82
Time: 2016-08-05
Author: 16sn6uv@gmail.com
File Name: mathics/builtin/comparison.py
Class Name:
Method Name: do_cmp


Project Name: mathics/Mathics
Commit Name: c52c7f1e9b97c4e75e579c429f3cf2381d0efbaa
Time: 2021-01-02
Author: rb@dustyfeet.com
File Name: mathics/builtin/arithmetic.py
Class Name: Sum
Method Name: to_sympy


Project Name: mathics/Mathics
Commit Name: 030ba1e631f2fa37b5e1a60691c310df8fee642b
Time: 2016-07-31
Author: 16sn6uv@gmail.com
File Name: mathics/builtin/arithmetic.py
Class Name: Power
Method Name: apply_check