In an if statement the first expression_list is executed only if the result of the boolean_expression is true. Otherwise the optional second expression_list in the else clause is executed.
if ( boolean_expression ) {
expression_list
}
else {
expression_list
}
Example 3.8 gives a possible MDL implementation of the function . Alternative implementations demonstrating more advanced features of MDL will be discussed in the following sections.
if ( fabs(x) > eps ) {
y = sin(x)/x;
}
else {
y = 1.0;
}
Example 3.8: Conditional expressions