"""Technical Committee threshold criterion.

The TechComm criterion requires a minimum number of votes from
Technical Committee members for certain decisions.

Formula: ceil(CoTecSize ^ T)
"""

from __future__ import annotations

import math


def techcomm_threshold(cotec_size: int, exponent: float = 0.1) -> int:
    """Compute the minimum number of TechComm member votes required.

    Parameters
    ----------
    cotec_size:
        Number of Technical Committee members.
    exponent:
        T in the formula ``ceil(cotec_size^T)``.

    Returns
    -------
    int
        Minimum TechComm votes required.
    """
    if cotec_size <= 0:
        raise ValueError("cotec_size doit etre strictement positif")
    return math.ceil(cotec_size ** exponent)
