def triangle_area(a, b, c):
    """
    Computes the area of a triangle.

    a,b,c -- Side lengths of the triangle.

    returns area
    returns 0 if sides are invalid.
    """
    s = (a + b + c)/2.0
    area_squared = s * (s - a) * (s - b) * (s - c)
    if area_squared < 0:
        return 0
    else:
        return area_squared ** 0.5