Exemplo n.º 1
0
def get_precision(prec, evaluation):
    if prec.get_name() == 'MachinePrecision':
        return numbers.prec(machine_precision)
    elif isinstance(prec, (Integer, Rational, Real)):
        return numbers.prec(prec.value)
    else:
        evaluation.message('N', 'precbd', prec)
        return None
Exemplo n.º 2
0
def get_precision(prec, evaluation):
    if prec.get_name() == 'MachinePrecision':
        return numbers.prec(machine_precision)
    elif isinstance(prec, (Integer, Rational, Real)):
        return numbers.prec(prec.value)
    else:
        evaluation.message('N', 'precbd', prec)
        return None
Exemplo n.º 3
0
def get_precision(precision, evaluation):
    if precision.get_name() == 'System`MachinePrecision':
        return machine_precision
    elif isinstance(precision, (Integer, Rational, Real)):
        return prec(float(precision.to_sympy()))
    else:
        evaluation.message('N', 'precbd', precision)
        return None
Exemplo n.º 4
0
def get_precision(precision, evaluation):
    if precision.get_name() == "MachinePrecision":
        return machine_precision
    elif isinstance(precision, (Integer, Rational, Real)):
        return prec(float(precision.to_sympy()))
    else:
        evaluation.message("N", "precbd", precision)
        return None
Exemplo n.º 5
0
def get_precision(precision, evaluation):
    if precision.get_name() == 'System`MachinePrecision':
        return machine_precision
    elif isinstance(precision, (Integer, Rational, Real)):
        return prec(float(precision.to_sympy()))
    else:
        evaluation.message('N', 'precbd', precision)
        return None