Is there some way to use compare for real-values?

I need to do some if-calculations like:

```
if VAL.1 < VAL.A
some calculation
else if VAL.1 > VAL.A
if VAL.1 < VAL.B
some calculation
else
some other calculation
```

How can I do this?

Is there some way to use compare for real-values?

I need to do some if-calculations like:

```
if VAL.1 < VAL.A
some calculation
else if VAL.1 > VAL.A
if VAL.1 < VAL.B
some calculation
else
some other calculation
```

How can I do this?

I’d suggest using a “switch” convert, the ‘link on’ and ‘link off’ attributes being respectively your if and else computations, the ‘switch’ bool being your comparison test.

Moreover at synfig.org/wiki/Convert#Switch

If it doesn’t work for you please tell me more about the result you expect from your calculation… this solution should work fine on any type of param (from real to list)

An alternative I already used is to improve the expression of your computation up to a point where you can make a single (mathematical) function out of it… but this usually requires a bit more work.

For interesting behaviors I usually start from one of

en.wikipedia.org/wiki/Periodic_function

en.wikipedia.org/wiki/Convex_function or

en.wikipedia.org/wiki/Nonlinear_system (see the pendulum example, for instance)

Thank you!

Using switches allowed me to do the calculations I want.

I wasn’t able to make a single function of it, would have been more elegant though…