math expression question

zqpm1qaz's picture

if a<b then a=0

'a' is float numbers. how to do that in qc math expression pacth?

thanks for the help!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

zanroversi's picture
Re: math expression question

hello,

You can use the ternary operator, it works inside mathematical expression :

a < b ? 0.0 : a

this means "if a < b then return 0.0 otherwise return a".

Or something like : !(a<b) * a

Bye !

zqpm1qaz's picture
Re: math expression question

Thanks! I will give it a try soon!

zqpm1qaz's picture
Re: math expression question

it work perfect´╝ü