def fwhm_to_sigma(min_x, max_x, fwhm):
    """
    When fitting an isotope pattern to a gaussian distribution, this function calculates the standard deviation sigma
    for the gaussian distribution.

    :param min_x: the lowest m/z value
    :param max_x: the highest m/z value
    :param fwhm: the full width at half maximum
    :return: Sigma
    :rtype: float
    :throws ValueError: if min_x > max_x or if not all inputs are greater than 0
    """
    if min_x > max_x:
        raise ValueError('min_x > max_x')
    if min(min_x, max_x, fwhm) <= 0:
        raise ValueError('all inputs must be greater than 0')
    sigma = fwhm / 2.3548200450309493
    return sigma
