def stag_pressure_ratio(M, gamma):
    """Stagnation pressure / static pressure ratio.

    Arguments:
        M (scalar): Mach number [units: dimensionless].
        gamma (scalar): Heat capacity ratio [units: dimensionless].

    Returns:
        scalar: the stagnation pressure ratio :math:`p_0 / p` [units: dimensionless].
    """
    return (1 + (gamma - 1) / 2 * M**2)**(gamma / (gamma - 1))