Exemplo n.º 1
0
def test_fractions_by_items_01_next_step():
    """Is this Product's calculation's next step correct?"""
    p = Product([
        Fraction((Item(3), Item(5))),
        Item(8),
        Fraction((Item(7), Item(11))),
        Item(4),
        Fraction((Item(13), Item(17)))
    ])
    assert p.calculate_next_step().printed == \
        wrap_nb('\\frac{3\\times 8\\times 7\\times 4\\times 13}{5\\times 11'
                '\\times 17}')
Exemplo n.º 2
0
def test_product_neg10x_next_step():
    """Is this Product's calculation's next step correct?"""
    p = Product([Monomial(('-', 10, 1))])
    p.set_exponent(2)
    assert p.calculate_next_step().printed == wrap_nb('100x^{2}')
Exemplo n.º 3
0
def test_fraction_by_item_02_next_step():
    """Is this Product's calculation's next step correct?"""
    p = Product([Item(8), Fraction((Item(5), Item(7)))])
    assert p.calculate_next_step().printed == wrap_nb('\\frac{8\\times 5}{7}')
Exemplo n.º 4
0
def test_fractions_product_next_step_01():
    """Is the next calculation's step of this Product correct?"""
    p = Product([Fraction(('+', -3, -2)), Fraction(('+', -1, 5))])
    assert p.calculate_next_step().printed == \
        wrap_nb('-\\frac{3\\times 1}{2\\times 5}')