def test_exponent__bigger_reverse(): sut = Scalar(3.76) assert eq_within_epsilon(8 ** sut, 2486.67)
def test_floor_divide__int_float_scalar(): sut = Scalar(1.5) assert eq_within_epsilon(5 // sut, 3)
def test_exponent__bigger(): sut = Scalar(3.76) assert eq_within_epsilon(sut ** 8, 39948.71)
def test_floor_divide__float_scalar_int(): sut = Scalar(3.33) assert eq_within_epsilon(sut // 3, 1)
def test_floor_divide__int_scalar(): sut = Scalar(3) assert eq_within_epsilon(2 // sut, 0)
def test_multiply__scalar_float_scalar(): sut = Scalar(3) sut2 = Scalar(4.2) assert eq_within_epsilon(sut * sut2, 12.6)
def test_multiply__float_scalar_int(): sut = Scalar(3.33) assert eq_within_epsilon(sut * 3, 9.99)
def test_subtract__scalar_float_scalar(): sut = Scalar(3) sut2 = Scalar(4.9) assert eq_within_epsilon(sut - sut2, -1.9)
def test_subtract__float_scalar_int(): sut = Scalar(3.33) assert eq_within_epsilon(sut - 3, 0.33)
def test_fraction__messy(): sut = Scalar(34, max=145) assert eq_within_epsilon(sut.fraction, 0.23)