ifelse
- If-else statement as a function
condition : | Bool (pass by const reference) |
A variable representing the condition of the if-else statement. | |
a : | Natural (pass by const reference) |
The value if the statement is true. | |
b : | Natural (pass by const reference) |
The value if the statement is false. |
a <- 1
b := ifelse( a == 1, 10, -10 )
b
a <- 2
b