If Condition

if('condition','true','false') - Returns 'true'-statement if logical 'condition'-statement is true (non-zero), 'false'-statement otherwise.

Advice: Choose it from the Programming palette

The "if" programming tool returns a value depending on Boolean 'condition'. Boolean condition can be formed by using Boolean palette. Here is a simple example, returning numeric or symbolic result.

if expressions with different comparison conditions

The user should take care when defining a function which uses "if". The Boolean condition could be sometimes quite "tricky". For example, if we want to find out if the y-value is inside (x,z) range we could do something like this.

chained comparison inside if, shown in a tooltip

It is advisable to see the tooltip and the order (precedence) of operators. The operators are usually calculated from left to right. Use ( ) - parenthesis if you have some doubts.

explicit conjunction inside if, shown in a tooltip

This page is based on a legacy wiki article by Will Massie.