def remcheck(val, range1, range2):
    """
    Checks whether value is within range of two decimals.

    Parameters
    ----------
    val : Float
        Value to be checked.
    range1 : Float
        Decimal 1.
    range2 : Float
        Decimal 2.

    Returns
    -------
    bool
        Result of check.

    """
    # function checks whether value is within range of two decimels
    if (range1 < range2):
        if (val > range1) and (val < range2):
            return True
        else:
            return False
    else:
        if (val > range1) or (val < range2):
            return True
        else:
            return False