Computer Programming/Error handling

function &radic; (X : in Float) : Float begin if (X < 0) : return -1 else calculate root from x fi end

C := &radic; (A2 + B2) if C < 0 then error handling else normal processing fi

function &radic; (   X       : in Float;     Success : out Boolean ) : Float begin if (X < 0) : Success := False else calculate root from x Success := True fi end

C := &radic; (A2 + B2, Success) if not Success then error handling else normal processing fi

function &radic; (X : in Float) : Float begin if (X < 0) : Float_Error := true else calculate root from x fi end

Float_Error := false C := &radic; (A2 + B2) if Float_Error then error handling else normal processing fi

function &radic; (X : in Float) : Float begin if (X < 0) : raise Float_Error else calculate root from x fi end

try: C := &radic; (A2 + B2) normal processing when Float_Error: error handling yrt

function &radic; (X : in Float) : Float pre-condition (X >= 0) post-condition (return >= 0) begin calculate root from x end

C := &radic; (A2 + B2)

Language overview
This list gives an overview of the standard or primary behavior and error handling techniques used in various programming languages. This does not mean that other techniques or behavior are not possible in the programming languages named.

1 : Ada supports a very limited form of DbC through its strong typing system. 2 : In C and C++ the behavior is defined and sometimes intentionally used however in this comparison we consider unintentional use.