Advanced Computing Environment
brix-os project page
// return value based on condition condition ? (true_value, false_value)
The IF extension executes a body of code if the evaluated condition is true. The optional ELSE body is executed when the condition is false. The optional comma is not allowed when the entire condition is wrapped in parentheses or when body1 is a block expression.
if a < b return a else return b
When both bodies are single expressions and both return values of similar types, then the IF extension will return the result of the executed expression.
// C: c = (a < b) ? a : b;
c = if(a < b) a else b
Copyright © 1995-2017 Brand Huntsman