def scalar_eq(a, b, precision=0):
    """Check if two scalars are equal.

    Keyword arguments:
    a -- first scalar
    b -- second scalar
    precision -- precision to check equality

    Returns:
    True if scalars are equal
    """
    return abs(a - b) <= precision
