Conditional Expressions

Syntax
result = condexp_rel(left, right, if_true, if_false)

Purpose
Record, as part of an operation sequence, the conditional result       if( left op right )           result = if_true      else result = if_false  The relation rel% , and operator op , have the following correspondence:       rel   lt   le   eq   ge   gt       op    <   <=   ==    >   >= 
rel
In the syntax above, the relation rel represents one of the following two characters: lt, le, eq, ge, gt. As in the table above, rel determines which comparison operator op is used when comparing left and right .

left
The argument left must have type a_float or a2float. It specifies the value for the left side of the comparison operator.

right
The argument right must have the same type as left . It specifies the value for the right side of the comparison operator.

if_true
The argument if_true must have the same type as left . It specifies the return value if the result of the comparison is true.

if_false
The argument if_false must have the same type as left . It specifies the return value if the result of the comparison is false.

result
This result has the same type as left .

Example
The file condexp.py contains an example and test of these functions.