Пример #1
0
def test_power_squared_root():
    expr = '9^0.5'
    parser = ExpressionParser(expr)
    assert parser.power() == 9**0.5
Пример #2
0
def test_power_squared_negative():
    expr = '-2^2'
    parser = ExpressionParser(expr)
    assert parser.power() == (-2)**2
Пример #3
0
def test_power_power_to_power():
    expr = '3^2^3'
    parser = ExpressionParser(expr)
    assert parser.power() == 3**2**3
Пример #4
0
def test_power_squared():
    expr = '2^2'
    parser = ExpressionParser(expr)
    assert parser.power() == 2**2