if. Choose one of the two branches

^if(logical expression){code to implement if condition is "true"}

^if(logical expression){
    code to implement if condition is true
}{
    code to implement if condition is false

}

The operator evaluates the value of a logical expression. Then, depending on the result obtained, the code for the "true" condition or the code for the "false" condition is executed. There are no limitations imposed on the code. For example, it may also contain one or more
if-statements.

^if(logical expression 1){
    code to implement if condition 1 is true
}(logical expression 2){
    code to implement if condition 2 is true
}…(logical expression N){
    code to implement if condition N is true
}{
    code to implement if condition N is false
}
   [3.4.1]


The operator evaluates the value of a logical expression. If the expression is true, the code for the "true" condition is executed. Otherwise, it moves to the next logical expression and the process repeats.

Important notice: we do recommend that you add comments to parts of complex mathematical expressions (see "Adding comments to parts of expressions").


Copyright © 1997–2025 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 17.04.2024