Utility¶
qm.qua.lib.Util ¶
cond
staticmethod
¶
cond(
condition: Scalar[bool],
true_result: Scalar[NumberT],
false_result: Scalar[NumberT],
) -> QuaLibFunctionOutput[NumberT]
Quick conditional operation. This is equivalent to a ternary operator available in some languages:
i.e. a ? b : c
, meaning b
if a
is true, or c
if a
is false.
There is less computation overhead (less latency) when running this operation relative to the if conditional.