# Python's arithmetic as Vibe takes it (D188): `&`, `|` and `^` of ints, float floor
# division and modulo, round to an int and to digits, divmod, a float power, and an int
# meeting a float. Its output is CPython's.
from verada import requires


def mixed(n: int, f: float) -> float:
    requires(-1000 <= n <= 1000 and -1000.0 <= f <= 1000.0)
    return n * f + n / 2


def main() -> None:
    x: int = 13
    print(x & 6, x | 2, x ^ 7, -13 & 6, -13 | 2, -13 ^ 7)
    x |= 16
    x &= 29
    print(x)
    a: float = -7.5
    b: float = 2.0
    print(a // b, a % b, 7.5 // 2, 7.5 % 2, -4.0 % 2.0, 4.0 % -2.0)
    print(round(2.5), round(3.5), round(-2.5), round(2.675, 2), round(1234.5678, -2), round(7))
    print(divmod(17, 5), divmod(-17, 5), divmod(7.5, 2.0))
    print(2 ** 0.5, 2.0 ** 3, 9.0 ** 0.5)
    n: int = 3
    f: float = 1.5
    print(n * f, f + n, n < f, n - f, mixed(4, 0.25))


if __name__ == "__main__":
    main()
