def test_decimal_var_type_compatibility():
    """Test that decimal.Decimal values are compatible with NumberVar type system."""
    dec_num = Var.create(decimal.Decimal("123.456"))
    int_num = Var.create(42)
    float_num = Var.create(3.14)

    result = dec_num + int_num
    assert str(result) == "(123.456 + 42)"

    result = dec_num * float_num
    assert str(result) == "(123.456 * 3.14)"

    result = (dec_num + int_num) / float_num
    assert str(result) == "((123.456 + 42) / 3.14)"
Test that decimal.Decimal values are compatible with NumberVar type system.
tests/units/test_var.py